Просмотр исходного кода

Provide hosts as environment settings and add npm run start script

James Allen 8 лет назад
Родитель
Сommit
b543031454

+ 2 - 2
services/notifications/config/settings.defaults.coffee

@@ -2,10 +2,10 @@ module.exports = Settings =
 	internal:
 		notifications:
 			port: 3042
-			host: "localhost"
+			host: process.env["LISTEN_ADDRESS"] or "localhost"
 
 	mongo:
-		url : 'mongodb://127.0.0.1/sharelatex'
+		url : "mongodb://#{process.env["MONGO_HOST"] or "localhost"}/sharelatex"
 
 	notifications:
 		healthCheck:

+ 3 - 1
services/notifications/package.json

@@ -4,12 +4,14 @@
   "description": "An API to handle user notifications",
   "main": "app.js",
   "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
+    "compile:app": "coffee -o app/js -c app/coffee && coffee -c app.coffee",
+    "start": "npm run compile:app && node app.js"
   },
   "author": "",
   "license": "ISC",
   "dependencies": {
     "async": "^0.1.22",
+    "coffee-script": "^1.7.1",
     "express": "3.1.0",
     "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.1.0",
     "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1",