Skip to content

express-app-lambda doesn't work - Cannot GET /claudia-test #32

Open
@daviddbal

Description

@daviddbal

I want to see Claudia act as a express wrapper. The example doesn't work. Below are the files:

lambda.js
'use strict'
const awsServerlessExpress = require('aws-serverless-express')
const app = require('./app')
const binaryMimeTypes = [
'application/octet-stream',
'font/eot',
'font/opentype',
'font/otf',
'image/jpeg',
'image/png',
'image/svg+xml'
]
const server = awsServerlessExpress.createServer(app, null, binaryMimeTypes);
exports.handler = (event, context) => awsServerlessExpress.proxy(server, event, context)

app.js
'use strict'
const express = require('express')
const app = express()

app.get('/', (req, res) => res.send('Hello World!')); // I simplified this line
// app.listen(3000) // <-- comment this line out from your app
module.exports = app // export your app so aws-serverless-express can use it


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions