I have followed this https://serverless.com/blog/serverless-express-rest-api/
to setting up serverless framework on AWS. I am successfully getting end points on cmd. But when I am hitting the end point url on browser, Json response is coming like
{“message”: “Internal server error”}.
Please check my code below, and let me know where am I wrong.
this is index.js code
// index.js
const serverless = require(‘serverless-http’);
const express = require(‘express’)
const app = express()
app.get(’/’, function (req, res) {
res.send(‘Hello World!’)
})
module.exports.handler = serverless(app);
####And sererless.yml code
service: my-express-application
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: us-east-1
functions:
app:
handler: index.handler
events:
- http: ANY /
- http: ‘ANY {proxy+}’