Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node10 example #76

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions oss/node-10/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 2 additions & 0 deletions oss/node-10/.upignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.lock
*.md
15 changes: 15 additions & 0 deletions oss/node-10/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Node 10

Node 10 application example.

## Setup

```
$ yarn
```

## Deploy

```
$ up
```
11 changes: 11 additions & 0 deletions oss/node-10/app.js
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions oss/node-10/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"axios": "^0.18.0"
}
}
6 changes: 6 additions & 0 deletions oss/node-10/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
up

curl -s `up url`
# contains:
# Response time: XXXms
# Node version: v10.XX.X
7 changes: 7 additions & 0 deletions oss/node-10/up.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "app",
"lambda": {
"runtime": "nodejs10.x",
"memory": 1024
}
}
35 changes: 35 additions & 0 deletions oss/node-10/yarn.lock
Original file line number Diff line number Diff line change
@@ -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"

[email protected]:
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==

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=