diff --git a/oss/node-10/.gitignore b/oss/node-10/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/oss/node-10/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/oss/node-10/.upignore b/oss/node-10/.upignore new file mode 100644 index 0000000..7934708 --- /dev/null +++ b/oss/node-10/.upignore @@ -0,0 +1,2 @@ +*.lock +*.md diff --git a/oss/node-10/Readme.md b/oss/node-10/Readme.md new file mode 100644 index 0000000..9127205 --- /dev/null +++ b/oss/node-10/Readme.md @@ -0,0 +1,15 @@ +# Node 10 + +Node 10 application example. + +## Setup + +``` +$ yarn +``` + +## Deploy + +``` +$ up +``` diff --git a/oss/node-10/app.js b/oss/node-10/app.js new file mode 100644 index 0000000..04e9aeb --- /dev/null +++ b/oss/node-10/app.js @@ -0,0 +1,11 @@ +const axios = require('axios') +const http = require('http') + +const { PORT = 3000 } = process.env +const url = 'https://apex.sh' + +http.createServer(async (req, res) => { + const start = Date.now() + await axios.get(url) + res.end(`Response time: ${Date.now() - start}ms\nNode version: ${process.version}`) +}).listen(PORT) diff --git a/oss/node-10/package.json b/oss/node-10/package.json new file mode 100644 index 0000000..8c94cff --- /dev/null +++ b/oss/node-10/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "axios": "^0.18.0" + } +} diff --git a/oss/node-10/test.sh b/oss/node-10/test.sh new file mode 100644 index 0000000..7319a50 --- /dev/null +++ b/oss/node-10/test.sh @@ -0,0 +1,6 @@ +up + +curl -s `up url` +# contains: +# Response time: XXXms +# Node version: v10.XX.X diff --git a/oss/node-10/up.json b/oss/node-10/up.json new file mode 100644 index 0000000..28d3fa6 --- /dev/null +++ b/oss/node-10/up.json @@ -0,0 +1,7 @@ +{ + "name": "app", + "lambda": { + "runtime": "nodejs10.x", + "memory": 1024 + } +} diff --git a/oss/node-10/yarn.lock b/oss/node-10/yarn.lock new file mode 100644 index 0000000..3d097a5 --- /dev/null +++ b/oss/node-10/yarn.lock @@ -0,0 +1,35 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +axios@^0.18.0: + version "0.18.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3" + integrity sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g== + dependencies: + follow-redirects "1.5.10" + is-buffer "^2.0.2" + +debug@=3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +follow-redirects@1.5.10: + version "1.5.10" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" + integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== + dependencies: + debug "=3.1.0" + +is-buffer@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" + integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=