diff options
author | Alan Pearce | 2017-06-30 22:08:54 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-30 22:08:54 +0200 |
commit | a5c463603d54d55bcca5fdd4e04117a4d027a3e6 (patch) | |
tree | 322d9eb26e72e31e91b71d5ff92d0fc30b637ce8 /src | |
parent | d3dfbb13b7037c9382bd8418e475ac4208216f39 (diff) | |
download | homestead-a5c463603d54d55bcca5fdd4e04117a4d027a3e6.tar.lz homestead-a5c463603d54d55bcca5fdd4e04117a4d027a3e6.tar.zst homestead-a5c463603d54d55bcca5fdd4e04117a4d027a3e6.zip |
feat(cli): accept argument for site directory
Add a script at the same time to enable using the test files for manual testing
Diffstat (limited to 'src')
-rw-r--r-- | src/index.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/index.js b/src/index.js index a3e8dea..2c75554 100644 --- a/src/index.js +++ b/src/index.js @@ -1,13 +1,18 @@ -'use strict' +"use strict"; -const config = require('./modules/config.js') +const config = require("./modules/config.js"); -const PORT = process.env.PORT || config.server.port +const PORT = process.env.PORT || config.server.port; +const targetDir = process.argv[2]; -const app = require('./app.js') +if (targetDir) { + process.chdir(targetDir); +} -module.exports = app +const app = require("./app.js"); + +module.exports = app; app.listen(PORT, () => { - console.log(`App listening on port ${PORT}`) -}) + console.log(`App listening on port ${PORT}`); +}); |