-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add runnable web app for
run.sh
demo
- Loading branch information
Showing
10 changed files
with
125 additions
and
14 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
packages/@aws-cdk/aws-lambda-nodejs/test/integ-handlers/ts-web-handler.ts
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,12 @@ | ||
import { Server } from 'http'; | ||
import { mult } from './util'; | ||
|
||
// Create simple http server | ||
const server = new Server((_req, res) => { | ||
res.writeHead(200, { 'Content-Type': 'text/plain' }); | ||
res.end(`${mult(3, 4)}`); | ||
console.log(mult(3, 4)); // eslint-disable-line no-console | ||
}); | ||
|
||
const port = parseInt(process.env.PORT || '3001', 10); | ||
server.listen(port); |
11 changes: 11 additions & 0 deletions
11
packages/@aws-cdk/aws-lambda-nodejs/test/integ-handlers/ts-web-run.sh
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,11 @@ | ||
#!/bin/sh | ||
|
||
# For AWS Lambda Adapter | ||
# https://github.com/awslabs/aws-lambda-web-adapter | ||
export READINESS_CHECK_PATH="${READINESS_CHECK_PATH:-/health}" | ||
export AWS_LAMBDA_EXEC_WRAPPER="${AWS_LAMBDA_EXEC_WRAPPER:-/opt/bootstrap}" | ||
export RUST_LOG="${RUST_LOG:-info}" | ||
export AWS_LWA_ENABLE_COMPRESSION="${AWS_LWA_ENABLE_COMPRESSION:-true}" | ||
export PORT="${PORT:-3001}" | ||
|
||
exec node index.js |
2 changes: 2 additions & 0 deletions
2
....snapshot/asset.a33898f49e24c41ff9be236439c418d30e576c5f57763097162d9ec4245216ce/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...pshot/asset.a33898f49e24c41ff9be236439c418d30e576c5f57763097162d9ec4245216ce/index.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...shot/asset.a33898f49e24c41ff9be236439c418d30e576c5f57763097162d9ec4245216ce/ts-web-run.sh
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,11 @@ | ||
#!/bin/sh | ||
|
||
# For AWS Lambda Adapter | ||
# https://github.com/awslabs/aws-lambda-web-adapter | ||
export READINESS_CHECK_PATH="${READINESS_CHECK_PATH:-/health}" | ||
export AWS_LAMBDA_EXEC_WRAPPER="${AWS_LAMBDA_EXEC_WRAPPER:-/opt/bootstrap}" | ||
export RUST_LOG="${RUST_LOG:-info}" | ||
export AWS_LWA_ENABLE_COMPRESSION="${AWS_LWA_ENABLE_COMPRESSION:-true}" | ||
export PORT="${PORT:-3001}" | ||
|
||
exec node index.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
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
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