diff --git a/oss/node-polka/.gitignore b/oss/node-polka/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/oss/node-polka/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/oss/node-polka/Readme.md b/oss/node-polka/Readme.md new file mode 100644 index 0000000..5c2782f --- /dev/null +++ b/oss/node-polka/Readme.md @@ -0,0 +1,15 @@ +# Node Express + +Simple [Polka](https://github.com/lukeed/polka) server + +## Setup + +``` +$ yarn +``` + +## Deploy + +``` +$ up +``` diff --git a/oss/node-polka/app.js b/oss/node-polka/app.js new file mode 100644 index 0000000..f1bc554 --- /dev/null +++ b/oss/node-polka/app.js @@ -0,0 +1,10 @@ +const polka = require('polka'); +const { PORT=3000 } = process.env; + +polka() + .get('/', (req, res) => { + res.end('Hello World from Polka!'); + }) + .listen(PORT).then(_ => { + console.log('> listening on %s', PORT); + }); diff --git a/oss/node-polka/package.json b/oss/node-polka/package.json new file mode 100644 index 0000000..0035b11 --- /dev/null +++ b/oss/node-polka/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "start": "node app" + }, + "dependencies": { + "polka": "^0.1.0" + } +} diff --git a/oss/node-polka/test.sh b/oss/node-polka/test.sh new file mode 100644 index 0000000..5b7aa57 --- /dev/null +++ b/oss/node-polka/test.sh @@ -0,0 +1,4 @@ +up + +curl -s `up url` +# equals: Hello World from Polka! diff --git a/oss/node-polka/up.json b/oss/node-polka/up.json new file mode 100644 index 0000000..fd1f8f6 --- /dev/null +++ b/oss/node-polka/up.json @@ -0,0 +1,3 @@ +{ + "name": "app" +} diff --git a/oss/node-polka/yarn.lock b/oss/node-polka/yarn.lock new file mode 100644 index 0000000..6f56228 --- /dev/null +++ b/oss/node-polka/yarn.lock @@ -0,0 +1,35 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@arr/every@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@arr/every/-/every-1.0.0.tgz#314f8168f50ae48a032cfdad5fdb436f464a97ac" + +"@arr/filter@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@arr/filter/-/filter-1.0.0.tgz#3d70902de9b5424bb5d5ceec00fd05f3d635e50f" + +matchit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/matchit/-/matchit-1.0.0.tgz#a484ccb5e264d97757a48a195c2a98ab3981b47b" + dependencies: + "@arr/every" "^1.0.0" + "@arr/filter" "^1.0.0" + +parseurl@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" + +polka@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/polka/-/polka-0.1.0.tgz#d5d11762e825b1f85489fe1ec6ac87304d3b5a3d" + dependencies: + parseurl "^1.3.2" + trouter "^1.0.0" + +trouter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trouter/-/trouter-1.0.0.tgz#4f845e0cdf4749276565d60f6dc9d61f55d6c0bb" + dependencies: + matchit "^1.0.0"