-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Request mapping functions must now return the body * Renamed CONTEXT_SUCCEED to CONTEXT * socketPath no longer needs to be returned by request mapping function
- Loading branch information
1 parent
a9c01a3
commit fe99c85
Showing
22 changed files
with
2,631 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
## Development | ||
|
||
1. `npm pack ../..` | ||
2. `npm install ./aws-serverless-express-3.3.5.tgz` | ||
3. `npm install --prefix ./src ./` | ||
4. `node local.js` | ||
```bash | ||
npm pack ../.. | ||
npm install ./aws-serverless-express-3.3.5.tgz | ||
npm install --prefix ./src ./ | ||
node local.js | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
// const awsServerlessExpress = require(process.env.NODE_ENV === 'test' ? '../../index' : 'aws-serverless-express') | ||
const awsServerlessExpress = require('aws-serverless-express') | ||
const app = require('./app') | ||
|
||
const ase = awsServerlessExpress.configure({ | ||
app, | ||
resolutionMode: 'PROMISE' | ||
// eventSource: '' | ||
app | ||
}) | ||
|
||
exports.handler = ase.handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
template.packaged.yaml | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Development | ||
|
||
``` | ||
npm pack ../.. | ||
npm install ./aws-serverless-express-3.3.5.tgz | ||
npm install --prefix ./src ./ | ||
node local.js | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"Records": [ | ||
{ | ||
"eventID": "93eea905b34daefbe0fe8a21858065a8", | ||
"eventName": "INSERT", | ||
"eventVersion": "1.1", | ||
"eventSource": "aws:dynamodb", | ||
"awsRegion": "us-east-1", | ||
"dynamodb": { | ||
"ApproximateCreationDateTime": 1560902007, | ||
"Keys": { | ||
"id": { | ||
"S": "b" | ||
} | ||
}, | ||
"NewImage": { | ||
"id": { | ||
"S": "b" | ||
} | ||
}, | ||
"SequenceNumber": "200000000000235577791", | ||
"SizeBytes": 6, | ||
"StreamViewType": "NEW_IMAGE" | ||
}, | ||
"eventSourceARN": "arn:aws:dynamodb:us-east-1:123123123:table/aws-serverless-express-dynamodb-example-Table-191RH2M1OU01V/stream/2019-06-18T23:42:52.038" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const lambdaFunction = require('./src/lambda.js') | ||
const albEvent = require('./dynamodb-event.json') | ||
|
||
const server = lambdaFunction.handler(albEvent, {}) | ||
.then(v => { | ||
console.info(v) | ||
process.exit(0) | ||
}) | ||
.catch(v => { | ||
console.error(v) | ||
process.exit(1) | ||
}) | ||
|
||
process.stdin.resume() | ||
|
||
function exitHandler (options, err) { | ||
if (options.cleanup && server && server.close) { | ||
server.close() | ||
} | ||
|
||
if (err) console.error(err.stack) | ||
if (options.exit) process.exit() | ||
} | ||
|
||
process.on('exit', exitHandler.bind(null, { cleanup: true })) | ||
process.on('SIGINT', exitHandler.bind(null, { exit: true })) // ctrl+c event | ||
process.on('SIGTSTP', exitHandler.bind(null, { exit: true })) // ctrl+v event | ||
process.on('uncaughtException', exitHandler.bind(null, { exit: true })) |
Oops, something went wrong.