1
0
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:
Patrik J. Braun 2018-12-27 23:56:57 +01:00 committed by GitHub
commit 113c723d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 3 deletions

View File

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

View File

@ -58,6 +58,7 @@ export interface ThreadingConfig {
export interface ServerConfig {
port: number;
host: string;
imagesFolder: string;
thumbnail: ThumbnailConfig;
threading: ThreadingConfig;

View File

@ -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',

View File

@ -71,7 +71,8 @@ export class SettingsService {
updateTimeout: 2000
},
imagesFolder: '',
port: 80,
port: 80,
host: '0.0.0.0',
thumbnail: {
folder: '',
qualityPriority: true,