diff options
-rwxr-xr-x | app.js | 5 | ||||
-rwxr-xr-x | start.sh | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | 'use strict'; | 3 | 'use strict'; |
4 | 4 | ||
5 | |||
5 | var express = require('express'), | 6 | var express = require('express'), |
6 | morgan = require('morgan'), | 7 | morgan = require('morgan'), |
7 | passport = require('passport'), | 8 | passport = require('passport'), |
@@ -13,7 +14,7 @@ var express = require('express'), | |||
13 | lastMile = require('connect-lastmile'), | 14 | lastMile = require('connect-lastmile'), |
14 | multipart = require('./src/multipart'), | 15 | multipart = require('./src/multipart'), |
15 | auth = require('./src/auth.js'), | 16 | auth = require('./src/auth.js'), |
16 | files = require('./src/files.js')(path.resolve(__dirname, 'files')); | 17 | files = require('./src/files.js')(path.resolve(__dirname, process.argv[2] || 'files')); |
17 | 18 | ||
18 | var app = express(); | 19 | var app = express(); |
19 | var router = new express.Router(); | 20 | var router = new express.Router(); |
@@ -40,9 +41,11 @@ app.use(passport.session()); | |||
40 | app.use(router); | 41 | app.use(router); |
41 | app.use(lastMile()); | 42 | app.use(lastMile()); |
42 | 43 | ||
44 | |||
43 | var server = app.listen(3000, function () { | 45 | var server = app.listen(3000, function () { |
44 | var host = server.address().address; | 46 | var host = server.address().address; |
45 | var port = server.address().port; | 47 | var port = server.address().port; |
46 | 48 | ||
47 | console.log('Surfer listening at http://%s:%s', host, port); | 49 | console.log('Surfer listening at http://%s:%s', host, port); |
50 | console.log('Using base path', path.resolve(__dirname, process.argv[2] || 'files')); | ||
48 | }); \ No newline at end of file | 51 | }); \ No newline at end of file |
@@ -4,5 +4,5 @@ set -eu | |||
4 | 4 | ||
5 | export NODE_ENV=production | 5 | export NODE_ENV=production |
6 | 6 | ||
7 | forever start --workingDir /app/code app.js | 7 | forever start --workingDir /app/code app.js /app/data |
8 | forever logs -f 0 \ No newline at end of file | 8 | forever logs -f 0 \ No newline at end of file |