jameskyburz / aws-lambda-http-server Goto Github PK
View Code? Open in Web Editor NEWrun your http server in a aws lambda function
Home Page: https://npm.im/aws-lambda-http-server
License: Apache License 2.0
run your http server in a aws lambda function
Home Page: https://npm.im/aws-lambda-http-server
License: Apache License 2.0
Hi!
Thank you for building this package (and the dep packages).
I tried this just like your demo but with a simple express server and serverless but however I noticed:
sls deploy
deploys to api gateaway as a REST Api (version 1)
2020-11-29T14:38:47.272Z a49f0436-6698-4feb-8b18-f70602c6700e ERROR TypeError: Cannot read property 'toLowerCase' of undefined at Route._handles_method (/var/task/node_modules/express/lib/router/route.js:63:21) at next (/var/task/node_modules/express/lib/router/index.js:244:30) at expressInit (/var/task/node_modules/express/lib/middleware/init.js:40:5) at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/var/task/node_modules/express/lib/router/index.js:317:13) at /var/task/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/var/task/node_modules/express/lib/router/index.js:335:12) at next (/var/task/node_modules/express/lib/router/index.js:275:10) at query (/var/task/node_modules/express/lib/middleware/query.js:45:5) at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5) | 2020-11-29T14:38:47.272Z a49f0436-6698-4feb-8b18-f70602c6700e ERROR TypeError: Cannot read property 'toLowerCase' of undefined at Route._handles_method (/var/task/node_modules/express/lib/router/route.js:63:21) at next (/var/task/node_modules/express/lib/router/index.js:244:30) at expressInit (/var/task/node_modules/express/lib/middleware/init.js:40:5) at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/var/task/node_modules/express/lib/router/index.js:317:13) at /var/task/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/var/task/node_modules/express/lib/router/index.js:335:12) at next (/var/task/node_modules/express/lib/router/index.js:275:10) at query (/var/task/node_modules/express/lib/middleware/query.js:45:5) at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5)
-- | --
Am I missing anything / doing something incorrectly?
Hi,
This package is exactly what I need, thanks so much for making it available!
I'm having a problem testing it with sls-offline.
Is there any reason why this wouldn't work with sls offline?
Below is the error that I'm getting. Thanks so much in advance for any help!
{
"errorMessage": "Uncaught error in your 'proxy' handler",
"errorType": "TypeError",
"stackTrace": [
"TypeError: Cannot read property 'replace' of undefined",
"at module.exports (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\aws-lambda-create-request-response\src\index.js:17:39)",
"at module.exports (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\aws-lambda-http-server\src\index.js:12:24)",
"at handler (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\serverless-offline\src\index.js:909:25)",
"at Object.internals.handler (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\handler.js:96:36)",
"at request._protect.run (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\handler.js:30:23)",
"at module.exports.internals.Protect.internals.Protect.run (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\protect.js:64:5)",
"at exports.execute (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\handler.js:24:22)",
"at each (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\request.js:384:16)",
"at iterate (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:36:13)",
"at done (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:28:25)",
"at internals.Auth.payload (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\auth.js:223:16)",
"at each (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\request.js:384:16)",
"at iterate (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:36:13)",
"at done (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:28:25)",
"at internals.payload (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\route.js:393:16)",
"at each (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\request.js:384:16)",
"at iterate (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:36:13)",
"at done (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:28:25)",
"at module.exports.internals.Auth.internals.Auth._authenticate (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\auth.js:210:16)",
"at internals.Auth.authenticate (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\auth.js:202:17)",
"at each (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\request.js:384:16)",
"at iterate (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:36:13)",
"at done (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:28:25)",
"at internals.state (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\route.js:357:16)",
"at each (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\request.js:384:16)",
"at iterate (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:36:13)",
"at Object.exports.serial (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\items\lib\index.js:39:9)",
"at internals.Request._lifecycle (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\request.js:387:11)",
"at internals.Request._execute (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\request.js:302:21)",
"at Domain.request._protect.enter (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\connection.js:261:25)",
"at Domain.run (domain.js:242:14)",
"at module.exports.internals.Protect.internals.Protect.enter (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\protect.js:80:17)",
"at Server. (C:\Users\christop\Documents\Stuff\Digital\Projects\testlambdaserver\node_modules\hapi\lib\connection.js:259:30)",
"at emitTwo (events.js:126:13)",
"at Server.emit (events.js:214:7)",
"at parserOnIncoming (_http_server.js:619:12)"
],
"offlineInfo": "If you believe this is an issue with the plugin please submit it, thanks. https://github.com/dherault/serverless-offline/issues"
}
Hi, can you please provide an example of how to use this packages with typescript
?
server.js
> server.ts
aws-lambda.js
> aws-lambda.ts
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
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.