sorry for such 101 question but I'm kinda new with AWS, NodeJS and Express.
I'm setting up a basic serverless API Gateway:
index.js
import AwsServerlessExpress from 'aws-serverless-express';
import App from './src/app';
const server = AwsServerlessExpress.createServer(App);
exports.handler = (event, context) => AwsServerlessExpress.proxy(server, event, context);
./src/app.js
import Express from 'express';
import BodyParser from 'body-parser';
import AwsServerlessExpressMiddleware from 'aws-serverless-express/middleware';
let app = Express();
app.use(BodyParser.json());
app.use(BodyParser.urlencoded({extended: true}));
app.use(AwsServerlessExpressMiddleware.eventContext());
app.get('/status', (req, res) => {
res.json({ a: "status" });
});
app.get('/', (req, res) => {
res.json({ a: "root" });
});
export default app;
And on the API Gateway console interface:
What's the problem here? If you need more information let me know please.
Thanks.