annotations
This commit is contained in:
+86
-3
@@ -6,16 +6,40 @@ import path from 'path'
|
||||
class Config{
|
||||
name = 'config';
|
||||
|
||||
/**
|
||||
* @class File system options , repository setup
|
||||
* @alias FileSystemOptions
|
||||
* @memberof Config
|
||||
*/
|
||||
fs = {
|
||||
/** Repository path
|
||||
* @type {string}
|
||||
* @memberof FileSystemOptions
|
||||
*/
|
||||
repo: null
|
||||
}
|
||||
|
||||
/**
|
||||
* @class Database options
|
||||
* @alias DatabaseOptions
|
||||
* @memberof Config
|
||||
*/
|
||||
db = {
|
||||
/** Database name
|
||||
* @type {string}
|
||||
* @memberof DatabaseOptions
|
||||
*/
|
||||
name:'pronature',
|
||||
|
||||
/** Database connection string
|
||||
* @type {string}
|
||||
* @memberof DatabaseOptions
|
||||
*/
|
||||
url: "mongodb://127.0.0.1:27017/pronature"
|
||||
}
|
||||
|
||||
/**
|
||||
* @class web site options
|
||||
* @class Web site endpoint options
|
||||
* @alias SiteOptions
|
||||
* @memberof Config
|
||||
*/
|
||||
@@ -25,38 +49,97 @@ class Config{
|
||||
* @memberof SiteOptions
|
||||
*/
|
||||
host:'https://localhost:5173',
|
||||
|
||||
/** Whether to use SSL
|
||||
* @type {boolean}
|
||||
* @memberof SiteOptions
|
||||
*/
|
||||
ssl: true,
|
||||
|
||||
/** Port to use
|
||||
* @type {Number}
|
||||
* @memberof SiteOptions
|
||||
*/
|
||||
port: 3000,
|
||||
|
||||
/**
|
||||
* @class certificate data
|
||||
* @class Certificate data
|
||||
* @alias CertificateOptions
|
||||
* @memberof SiteOptions
|
||||
*/
|
||||
certificate: {
|
||||
/**
|
||||
* Certificate key
|
||||
* Certificate private key
|
||||
* @type {string}
|
||||
* @memberof CertificateOptions
|
||||
*/
|
||||
key: './.cert/dev-key.pem',
|
||||
|
||||
/**
|
||||
* Certificate public key
|
||||
* @type {string}
|
||||
* @memberof CertificateOptions
|
||||
*/
|
||||
cert: './.cert/dev-cert.pem',
|
||||
|
||||
/**
|
||||
* PK Passphrase
|
||||
* @type {string}
|
||||
* @memberof CertificateOptions
|
||||
*/
|
||||
passphrase: 'parola'
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* @class Access management options
|
||||
* @alias AccessManagementOptions
|
||||
* @memberof Config
|
||||
*/
|
||||
am = {
|
||||
/**
|
||||
* Salt, a string to be used in order to make a more complex password hash
|
||||
* @type {string}
|
||||
* @memberof AccessManagementOptions
|
||||
*/
|
||||
salt : 'P@ssSal7y!!',
|
||||
|
||||
/**
|
||||
* @class Cookie options
|
||||
* @alias CookieOptions
|
||||
* @memberof AccessManagementOptions
|
||||
*/
|
||||
cookie: {
|
||||
/**
|
||||
* Cookie secret
|
||||
* @type {string}
|
||||
* @memberof CookieOptions
|
||||
*/
|
||||
secret: 'S3cret4C00k!ie$',
|
||||
|
||||
/**
|
||||
* Cookie max age (in seconds)
|
||||
* @type {Number}
|
||||
* @memberof CookieOptions
|
||||
*/
|
||||
maxAge: 1000 * 60 * 60 * 24 * 7
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the configuration
|
||||
* @param {App} app The application
|
||||
*/
|
||||
async init(app){
|
||||
if (!this.fs.repo){
|
||||
this.fs.repo = path.resolve(`${app.root}/repo`) + '/';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the configuration plugin
|
||||
* @param {App} app the application instance
|
||||
*/
|
||||
async start(app){
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user