kksharma1618 / lambda-restify Goto Github PK
View Code? Open in Web Editor NEWA restify/expressjs like interface for aws lamda with api gateway event
License: MIT License
A restify/expressjs like interface for aws lamda with api gateway event
License: MIT License
When used with AWS SAM $> sam local start-api
command to run as a local lambda, fronted by its mock AWS API Gateway; and upon a curl call $> curl -X POST http://localhost:port/theapi ...
I received an {"message":"Internal server error"}
response as the curl response. Server-side, it logged the following:
2018-08-10 16:48:18 statusCode must be a positive int
2018-08-10 16:48:18 Function returned an invalid response (must include one of: body, headers or statusCode in the response object). Response received: {"statusCode":"200","body":"{\"Errors\":[{\"Expectation\":\"Required\", ...redacted}]}","headers":{"server":"","content-type":"application/json","date":"Fri, 10 Aug 2018 16:48:17 GMT","content-length":152}}
2018-08-10 16:48:18 127.0.0.1 - - [10/Aug/2018 16:48:18] "POST /theapi HTTP/1.1" 502 -
How could I change or override the response before its sent out so from {"statusCode":"200"...}
to {"statusCode": 200...}
?
Not sure if this is a real bug or a user-error (me).
Thanks.
Hi, I followed the steps of the documentation but I get the following error:
{
"errorMessage": "Error while loading users",
"errorType": "TypeError",
"stackTrace": [
"TypeError: Server is not a constructor"
.....
....
...
}
Hi,
As suggested, I'm using Node.js version is 6.10.2.
The following code
'use strict';
const Server = require('lambda-restify');
const server = new Server();
throws an error:
TypeError: Server is not a constructor
What should we do make this work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.