From 53aebb365ed1bac94f535a0d5ca058cb57b649db Mon Sep 17 00:00:00 2001 From: monoid Date: Sat, 9 Jan 2021 23:38:44 +0900 Subject: [PATCH] port setting --- src/server.ts | 2 +- src/setting.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server.ts b/src/server.ts index 80445dd..f0f0467 100644 --- a/src/server.ts +++ b/src/server.ts @@ -76,7 +76,7 @@ async function main(){ app.use(router.allowedMethods()); console.log("start server"); - app.listen(8080,settings.localmode ? "127.0.0.1" : "0.0.0.0"); + app.listen(settings.port,settings.localmode ? "127.0.0.1" : "0.0.0.0"); return app; } main(); \ No newline at end of file diff --git a/src/setting.ts b/src/setting.ts index acd59c2..4e946e9 100644 --- a/src/setting.ts +++ b/src/setting.ts @@ -6,13 +6,15 @@ export type Setting = { path: string[], localmode: boolean, guest: boolean, - jwt_secretkey: string + jwt_secretkey: string, + port:number, } const default_setting:Setting = { path:[], localmode: true, guest:false, jwt_secretkey:"itsRandom", + port:8080, } let setting: null|Setting = null;