logging & missing func & allow respawning on crash
This commit is contained in:
parent
bf6acbbadf
commit
466544b8ed
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"serverFilePath": "./src/server/Server.js",
|
"serverFilePath": "./src/server/Server.js",
|
||||||
"shardOptions": {
|
"shardOptions": {
|
||||||
"respawn": false
|
"respawn": true
|
||||||
},
|
},
|
||||||
"shardCount": 1,
|
"shardCount": 1,
|
||||||
"serverOptions": {
|
"serverOptions": {
|
||||||
|
@ -201,7 +201,7 @@ class Server extends EventEmitter {
|
|||||||
|
|
||||||
#logRequest (req, res, next) {
|
#logRequest (req, res, next) {
|
||||||
res.once('finish', () => {
|
res.once('finish', () => {
|
||||||
this.logger[[ 401, 403 ].includes(res.statusCode) ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] Request to [${req.method}] ${req.route?.path || req.path}`);
|
this.logger[[ 401, 403 ].includes(res.statusCode) ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] ${req.user ? `${req.user.name} (${req.user.id})` : '-'} Request to [${req.method}] ${req.route?.path || req.path}`);
|
||||||
});
|
});
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
@ -59,12 +59,9 @@ class User extends AbstractUser {
|
|||||||
return Object.freeze({ ...this.#_externalProfiles });
|
return Object.freeze({ ...this.#_externalProfiles });
|
||||||
}
|
}
|
||||||
|
|
||||||
// async fetchApplications () {
|
async fetchApplications () {
|
||||||
// const apps = await Promise.all(this._applications.map(id => this._db.fetchApplication(id)));
|
return Promise.all(this.#_applications.map(id => this._db.fetchApplication(id)));
|
||||||
// for (const app of apps)
|
}
|
||||||
// this.applications[app.id] = app;
|
|
||||||
// return this.applications;
|
|
||||||
// }
|
|
||||||
|
|
||||||
async createApplication (name, { description } = {}, saveFn) {
|
async createApplication (name, { description } = {}, saveFn) {
|
||||||
if (typeof saveFn !== 'function')
|
if (typeof saveFn !== 'function')
|
||||||
|
Loading…
Reference in New Issue
Block a user