From fae74e10ffcc5562b0b081b7307c4a425f7c530e Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Wed, 9 Sep 2020 14:32:23 +0000 Subject: [PATCH] accept port parameter --- api/server.mjs | 4 ++-- index.mjs | 4 ++-- publish.bat | 11 ----------- 3 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 publish.bat diff --git a/api/server.mjs b/api/server.mjs index 58061ce..eb4da68 100644 --- a/api/server.mjs +++ b/api/server.mjs @@ -2,7 +2,7 @@ import path from 'path' import { readFileSync } from 'fs' import { fileURLToPath } from 'url' -export function run(config, db, log, core, http) { +export function run(config, db, log, core, http, orgPort) { const __dirname = path.dirname(fileURLToPath(import.meta.url)) const staticPackage = path.join(__dirname,'../package.json') let packageInfo = JSON.parse(readFileSync(staticPackage)) @@ -13,7 +13,7 @@ export function run(config, db, log, core, http) { res.end() }) - let port = config.port || 4000 + let port = orgPort || 4000 server.listen(port, '0.0.0.0', function(err) { if (err) { diff --git a/index.mjs b/index.mjs index 888af29..ac92217 100644 --- a/index.mjs +++ b/index.mjs @@ -1,5 +1,5 @@ -export function start(config, db, log, core, http) { +export function start(config, db, log, core, http, port) { return import('./api/server.mjs').then(function(module) { - return module.run(config, db, log, core, http) + return module.run(config, db, log, core, http, port) }) } \ No newline at end of file diff --git a/publish.bat b/publish.bat deleted file mode 100644 index 5410f7f..0000000 --- a/publish.bat +++ /dev/null @@ -1,11 +0,0 @@ -@ECHO off -SETLOCAL EnableDelayedExpansion - -ECHO. -set /p version="Print version you wanna publish: " -ECHO. -ECHO npm version !version! -npm version !version! -ECHO git push -git push -ECHO.