1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/common/config/private/PrivateConfigClass.ts
2017-06-11 23:33:47 +02:00

42 lines
991 B
TypeScript

import {PublicConfigClass} from "../public/ConfigClass";
import {DatabaseType, ServerConfig, ThumbnailProcessingLib} from "./IPrivateConfig";
/**
* This configuration will be only at backend
*/
export class PrivateConfigClass extends PublicConfigClass {
public Server: ServerConfig = {
port: 80,
imagesFolder: "demo/images",
thumbnail: {
folder: "demo/TEMP",
processingLibrary: ThumbnailProcessingLib.sharp,
qualityPriority: true
},
database: {
type: DatabaseType.mysql,
mysql: {
host: "localhost",
username: "root",
password: "root",
database: "pigallery2"
}
},
enableThreading: true
};
public setDatabaseType(type: DatabaseType) {
this.Server.database.type = type;
if (type === DatabaseType.memory) {
this.Client.Search.searchEnabled = false;
this.Client.Search.instantSearchEnabled = false;
this.Client.Search.autocompleteEnabled = false;
}
}
}