accept port parameter

This commit is contained in:
Jonatan Nilsson 2020-09-09 14:32:23 +00:00
parent 0ad204c8f9
commit fae74e10ff
3 changed files with 4 additions and 15 deletions

View file

@ -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) {

View file

@ -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)
})
}

View file

@ -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.