Set host in Fastify
This commit is contained in:
parent
d98d59705a
commit
fe9562b596
|
|
@ -1,4 +1,4 @@
|
|||
import Fastify, { FastifyInstance } from "fastify";
|
||||
import Fastify, { FastifyInstance, FastifyListenOptions } from "fastify";
|
||||
import fastifyMultipart from "@fastify/multipart";
|
||||
import cors from '@fastify/cors';
|
||||
|
||||
|
|
@ -150,9 +150,19 @@ export class UserManagementServer
|
|||
|
||||
async _startServer()
|
||||
{
|
||||
let listenOptions:FastifyListenOptions =
|
||||
{
|
||||
port: this._settings.port
|
||||
}
|
||||
|
||||
if ( ! this._settings.isDebugMode )
|
||||
{
|
||||
listenOptions.host = "0.0.0.0";
|
||||
}
|
||||
|
||||
this.app.listen(
|
||||
|
||||
{ port: this._settings.port },
|
||||
listenOptions,
|
||||
|
||||
( error, address ) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ export class UserManagementServerSettings
|
|||
url:string;
|
||||
port:number = 8084;
|
||||
corsURLs:string[] = [];
|
||||
isDebugMode:boolean = false;
|
||||
|
||||
// Paths
|
||||
rootPath:string;
|
||||
|
|
|
|||
Loading…
Reference in New Issue