accept port parameter
This commit is contained in:
parent
0ad204c8f9
commit
fae74e10ff
3 changed files with 4 additions and 15 deletions
|
@ -2,7 +2,7 @@ import path from 'path'
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { fileURLToPath } from 'url'
|
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 __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||||
const staticPackage = path.join(__dirname,'../package.json')
|
const staticPackage = path.join(__dirname,'../package.json')
|
||||||
let packageInfo = JSON.parse(readFileSync(staticPackage))
|
let packageInfo = JSON.parse(readFileSync(staticPackage))
|
||||||
|
@ -13,7 +13,7 @@ export function run(config, db, log, core, http) {
|
||||||
res.end()
|
res.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
let port = config.port || 4000
|
let port = orgPort || 4000
|
||||||
|
|
||||||
server.listen(port, '0.0.0.0', function(err) {
|
server.listen(port, '0.0.0.0', function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -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 import('./api/server.mjs').then(function(module) {
|
||||||
return module.run(config, db, log, core, http)
|
return module.run(config, db, log, core, http, port)
|
||||||
})
|
})
|
||||||
}
|
}
|
11
publish.bat
11
publish.bat
|
@ -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.
|
|
Loading…
Reference in a new issue