Skip to content

Commit

Permalink
fix handler path
Browse files Browse the repository at this point in the history
  • Loading branch information
jgtvares committed Dec 27, 2021
1 parent 1803872 commit 058523a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ const download = require('@vercel/build-utils/fs/download'); // eslint-disable-l
const glob = require('@vercel/build-utils/fs/glob'); // eslint-disable-line import/no-extraneous-dependencies
const { createLambda } = require('@vercel/build-utils/lambda'); // eslint-disable-line import/no-extraneous-dependencies

const { log, pip, python, linux } = require('./build-utils');
const {
log,
pip,
python,
linux,
} = require('./build-utils');


exports.config = {
Expand Down Expand Up @@ -58,7 +63,7 @@ exports.build = async ({ files, entrypoint, config }) => {
if (requirementsTxtPath) {
await pip.install(pipPath, srcDir, '-r', requirementsTxtPath);
}

log.heading('Running post script');
setupPath = linux.findPostRequirements(entrypoint, files);
if (setupPath) {
Expand All @@ -69,7 +74,7 @@ exports.build = async ({ files, entrypoint, config }) => {

const lambda = await createLambda({
files: await glob('**', srcDir),
handler: 'lambda.handler',
handler: 'lambda.vercel_handler',
runtime: `${config.runtime || 'python3.8'}`,
environment: {
WSGI_APPLICATION: `${wsgiApplication}`,
Expand Down
2 changes: 0 additions & 2 deletions lambda/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@


def handler(app, lambda_event):
print(app)
print(json.loads(lambda_event))
event = json.loads(lambda_event['body'])
headers = Headers(event.get('headers', None))
parsed_url = urlparse(event['path'])
Expand Down

0 comments on commit 058523a

Please sign in to comment.