From 84815ce2fa884d6ebc3992003429dec38c5b0b17 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Mon, 11 Jul 2016 12:00:20 -0700 Subject: [PATCH] Add file watching to restart server --- .gitignore | 1 + package.json | 3 +-- pm2-dev.yml | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ce1018e2e..e5ddc09e2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dump.rdb *npm-debug.log storage/ lerna-debug.log +newrelic_agent.log # Elastic Beanstalk Files .elasticbeanstalk/* diff --git a/package.json b/package.json index a94202966..7a33802a6 100644 --- a/package.json +++ b/package.json @@ -27,10 +27,9 @@ "sqlite3": "https://github.com/bengotow/node-sqlite3/archive/bengotow/usleep-v3.1.4.tar.gz" }, "scripts": { - "start": "pm2 start ./pm2-dev.yml; pm2 logs --raw | bunyan -o short", + "start": "pm2 start ./pm2-dev.yml --watch; pm2 logs --raw | bunyan -o short", "logs": "pm2 logs --raw | bunyan -o short", "stop": "pm2 delete all", - "restart": "npm run stop && npm run start", "postinstall": "lerna bootstrap" }, "repository": { diff --git a/pm2-dev.yml b/pm2-dev.yml index a88d4e8c2..4f60094fd 100644 --- a/pm2-dev.yml +++ b/pm2-dev.yml @@ -4,6 +4,7 @@ apps: - script : packages/nylas-api/app.js + watch : true name : api env : PORT: 5100 @@ -14,12 +15,14 @@ apps: GMAIL_REDIRECT_URL : "http://localhost:5100/auth/gmail/oauthcallback" NODE_ENV: 'development' - script : packages/nylas-sync/app.js + watch : true name : sync env : DB_ENCRYPTION_ALGORITHM : "aes-256-ctr" DB_ENCRYPTION_PASSWORD : "d6F3Efeq" NODE_ENV: 'development' - script : packages/nylas-dashboard/app.js + watch : true name : dashboard env : PORT: 5101 @@ -27,6 +30,7 @@ apps: DB_ENCRYPTION_PASSWORD : "d6F3Efeq" NODE_ENV: 'development' - script : packages/nylas-message-processor/app.js + watch : true name : processor env : DB_ENCRYPTION_ALGORITHM : "aes-256-ctr"