From a86957386f7492d53c894137823009e99ecbe4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marwan=20Rabb=C3=A2a?= Date: Mon, 11 Jun 2018 17:42:01 +0200 Subject: [PATCH] re-enable rayo (#246) --- Makefile | 5 ++++- neph.yaml | 5 +++++ node/rayo/Dockerfile | 13 +++++++++++++ node/rayo/app.js | 7 +++++++ node/rayo/package.json | 5 +++++ tools/src/benchmarker.cr | 1 + 6 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 node/rayo/Dockerfile create mode 100644 node/rayo/app.js create mode 100644 node/rayo/package.json diff --git a/Makefile b/Makefile index 236e0603a50..3d968117d8a 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ phoenix: docker build -t phoenix elixir/phoenix # --- node.js --- -node: express fastify polka +node: express fastify polka rayo express: docker build -t express node/express @@ -21,6 +21,9 @@ fastify: polka: docker build -t polka node/polka +rayo: + docker build -t rayo node/rayo + # --- Objective-C --- objc: criollo diff --git a/neph.yaml b/neph.yaml index 980e8790fbe..5845395ee62 100644 --- a/neph.yaml +++ b/neph.yaml @@ -70,6 +70,7 @@ node: - express - fastify - polka + - rayo elixir: depends_on: @@ -224,6 +225,10 @@ polka: command: docker build -t polka . dir: node/polka +rayo: + command: docker build -t rayo . + dir: node/rayo + plug: command: docker build -t plug . dir: elixir/plug diff --git a/node/rayo/Dockerfile b/node/rayo/Dockerfile new file mode 100644 index 00000000000..d17a39e88a0 --- /dev/null +++ b/node/rayo/Dockerfile @@ -0,0 +1,13 @@ +FROM node + +RUN npm -g install pm2 + +WORKDIR /usr/src/app + +COPY app.js package.json ./ + +RUN npm install + +ENV NODE_ENV production + +CMD pm2-runtime start app.js -i $(nproc) diff --git a/node/rayo/app.js b/node/rayo/app.js new file mode 100644 index 00000000000..01f0ee82abf --- /dev/null +++ b/node/rayo/app.js @@ -0,0 +1,7 @@ +const rayo = require('rayo'); + +rayo({ port: 3000 }) + .get('/', (req, res) => res.end('')) + .get('/user/:id', (req, res) => res.end(req.params.id)) + .post('/user', (req, res) => res.end('')) + .start(); diff --git a/node/rayo/package.json b/node/rayo/package.json new file mode 100644 index 00000000000..584a33c379b --- /dev/null +++ b/node/rayo/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "rayo": "~1.0.4" + } +} diff --git a/tools/src/benchmarker.cr b/tools/src/benchmarker.cr index a9cf504a631..a9679390d9b 100644 --- a/tools/src/benchmarker.cr +++ b/tools/src/benchmarker.cr @@ -76,6 +76,7 @@ LANGS = [ {name: "express", repo: "expressjs/express"}, {name: "fastify", repo: "fastify/fastify"}, {name: "polka", repo: "lukeed/polka"}, + {name: "rayo", repo: "GetRayo/rayo.js"}, ]}, {lang: "elixir", targets: [ {name: "plug", repo: "elixir-lang/plug"},