From ad66f9bb3288fb49cf1b16d49c91746d8203fb47 Mon Sep 17 00:00:00 2001 From: Sejin Jeon Date: Sat, 11 Aug 2018 22:41:15 +0000 Subject: [PATCH 1/4] Automatize the installation process A user had to type 'y' or '2' in the middle of the installation process. By adding options like '-y' or '--minimal', users can escape from these troublesome works. --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index e5b7bc5..b603125 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ -apt-get install apache2-utils -apt-get install npm +apt-get install apache2-utils -y +apt-get install npm -y npm install n -g n latest npm install hapi @@ -14,6 +14,6 @@ adonis new yardstick cp yardstick-changes/app/Http/kernel.js yardstick/app/Http/kernel.js cp yardstick-changes/app/Http/routes.js yardstick/app/Http/routes.js npm install sails -g -sails new test-project +sails new test-project --minimal cp test-project-changes/api/controllers/ApiController.js test-project/api/controllers/ApiController.js -cp test-project-changes/config/routes.js test-project/config/routes.js \ No newline at end of file +cp test-project-changes/config/routes.js test-project/config/routes.js From b1e3e594704591df794137fe91e5c959f4334b53 Mon Sep 17 00:00:00 2001 From: Sejin Jeon Date: Sat, 11 Aug 2018 22:45:41 +0000 Subject: [PATCH 2/4] Add the module installation process The yardstick project of Adonis framework needs to install modules that it has dependencies on. --- install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.sh b/install.sh index b603125..8055885 100644 --- a/install.sh +++ b/install.sh @@ -11,6 +11,9 @@ npm install n npm install total.js npm install adonis-cli -g adonis new yardstick +cd ./yardstick +npm install +cd .. cp yardstick-changes/app/Http/kernel.js yardstick/app/Http/kernel.js cp yardstick-changes/app/Http/routes.js yardstick/app/Http/routes.js npm install sails -g From 4a01651c9c0ef170562c044e1777a0cb1daf6448 Mon Sep 17 00:00:00 2001 From: Sejin Jeon Date: Sat, 11 Aug 2018 23:00:15 +0000 Subject: [PATCH 3/4] Change a command for Adonis Because of the version up of node-req, `npm start run` command doesn't work on Adonis. --- run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index c8124c4..e3a1734 100644 --- a/run.sh +++ b/run.sh @@ -45,8 +45,8 @@ sleep 5 echo adonis.js >> results.txt ; cd yardstick ; -npm start run & sleep 5 ; +npm run serve & sleep 5 ; cd ..; ab -k -n 50000 -c 100 -t 20 http://127.0.0.1:3333/ | grep "Requests per second:" >> results.txt ; pkill -f server.js ; -sleep 5 \ No newline at end of file +sleep 5 From 6f1a800fde50bf18b0d12e06685b8b17fa6f2fdf Mon Sep 17 00:00:00 2001 From: Sejin Jeon Date: Sat, 11 Aug 2018 23:10:02 +0000 Subject: [PATCH 4/4] Change code of hapiserver.js into a changed grammar See this: https://github.com/hapijs/hapi/issues/3692 --- hapiserver.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hapiserver.js b/hapiserver.js index ee3015e..d078694 100644 --- a/hapiserver.js +++ b/hapiserver.js @@ -3,8 +3,7 @@ const Hapi = require('hapi'); // Create a server with a host and port -const server = new Hapi.Server(); -server.connection({ +const server = new Hapi.Server({ host: 'localhost', port: 8000 });