65 lines
1.3 KiB
JavaScript
65 lines
1.3 KiB
JavaScript
import path from 'path'
|
|
|
|
/**
|
|
* Configuration class
|
|
*/
|
|
class Config{
|
|
name = 'config';
|
|
|
|
fs = {
|
|
repo: null
|
|
}
|
|
db = {
|
|
name:'pronature',
|
|
url: "mongodb://127.0.0.1:27017/pronature"
|
|
}
|
|
|
|
/**
|
|
* @class web site options
|
|
* @alias SiteOptions
|
|
* @memberof Config
|
|
*/
|
|
site = {
|
|
/** Host name
|
|
* @type {string}
|
|
* @memberof SiteOptions
|
|
*/
|
|
host:'https://localhost:5173',
|
|
ssl: true,
|
|
port: 3000,
|
|
/**
|
|
* @class certificate data
|
|
* @alias CertificateOptions
|
|
* @memberof SiteOptions
|
|
*/
|
|
certificate: {
|
|
/**
|
|
* Certificate key
|
|
* @type {string}
|
|
* @memberof CertificateOptions
|
|
*/
|
|
key: './.cert/dev-key.pem',
|
|
cert: './.cert/dev-cert.pem',
|
|
passphrase: 'parola'
|
|
},
|
|
}
|
|
am = {
|
|
salt : 'P@ssSal7y!!',
|
|
cookie: {
|
|
secret: 'S3cret4C00k!ie$',
|
|
maxAge: 1000 * 60 * 60 * 24 * 7
|
|
}
|
|
}
|
|
|
|
async init(app){
|
|
if (!this.fs.repo){
|
|
this.fs.repo = path.resolve(`${app.root}/repo`) + '/';
|
|
}
|
|
}
|
|
|
|
async start(app){
|
|
|
|
}
|
|
}
|
|
|
|
export { Config }; |