mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Merge pull request #30 from bobobo1618/master
Add a configurable listen host
This commit is contained in:
commit
113c723d3f
@ -40,7 +40,7 @@ export class Server {
|
||||
throw error;
|
||||
}
|
||||
|
||||
const bind = 'Port ' + Config.Server.port;
|
||||
const bind = Config.Server.host + ':' + Config.Server.port;
|
||||
|
||||
// handle specific listen error with friendly messages
|
||||
switch (error.code) {
|
||||
@ -138,7 +138,7 @@ export class Server {
|
||||
this.server = _http.createServer(this.app);
|
||||
|
||||
// Listen on provided PORT, on all network interfaces.
|
||||
this.server.listen(Config.Server.port);
|
||||
this.server.listen(Config.Server.port, Config.Server.host);
|
||||
this.server.on('error', this.onError);
|
||||
this.server.on('listening', this.onListening);
|
||||
|
||||
|
@ -58,6 +58,7 @@ export interface ThreadingConfig {
|
||||
|
||||
export interface ServerConfig {
|
||||
port: number;
|
||||
host: string;
|
||||
imagesFolder: string;
|
||||
thumbnail: ThumbnailConfig;
|
||||
threading: ThreadingConfig;
|
||||
|
@ -13,6 +13,7 @@ export class PrivateConfigClass extends PublicConfigClass implements IPrivateCon
|
||||
|
||||
public Server: ServerConfig = {
|
||||
port: 80,
|
||||
host: '0.0.0.0',
|
||||
imagesFolder: 'demo/images',
|
||||
thumbnail: {
|
||||
folder: 'demo/TEMP',
|
||||
|
@ -71,7 +71,8 @@ export class SettingsService {
|
||||
updateTimeout: 2000
|
||||
},
|
||||
imagesFolder: '',
|
||||
port: 80,
|
||||
port: 80,
|
||||
host: '0.0.0.0',
|
||||
thumbnail: {
|
||||
folder: '',
|
||||
qualityPriority: true,
|
||||
|
Loading…
Reference in New Issue
Block a user