miolo 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cacher/index.js +3 -3
- package/lib/config/defaults.js +1 -1
- package/lib/db/conn.js +2 -2
- package/lib/logger/index.js +7 -7
- package/lib/server/engines/cron/syscheck.js +4 -4
- package/lib/server/engines/socket/index.js +3 -3
- package/lib/server/middleware/request.js +2 -2
- package/lib/server/routes/catch_js_error.js +1 -1
- package/lib/server/routes/html_render.js +1 -1
- package/package.json +4 -4
- package/src/cacher/index.js +5 -5
- package/src/config/defaults.js +1 -1
- package/src/db/conn.js +2 -2
- package/src/logger/index.js +8 -8
- package/src/server/engines/cron/syscheck.js +5 -5
- package/src/server/engines/socket/index.js +4 -4
- package/src/server/middleware/request.js +5 -5
- package/src/server/routes/catch_js_error.js +7 -7
- package/src/server/routes/html_render.js +2 -2
package/lib/cacher/index.js
CHANGED
|
@@ -19,14 +19,14 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
19
19
|
|
|
20
20
|
function init_cacher(config) {
|
|
21
21
|
var client = _redis.default.createClient(config.redis.port, config.redis.host).on('connect', function () {
|
|
22
|
-
console.info("".concat((0, _farrapaColors.
|
|
22
|
+
console.info("".concat((0, _farrapaColors.magenta)('REDIS'), " Connection established!"));
|
|
23
23
|
}).on('error', function (err) {
|
|
24
24
|
var msg;
|
|
25
25
|
|
|
26
26
|
try {
|
|
27
|
-
if (err instanceof _redis.default.ReplyError) msg = "".concat((0, _farrapaColors.
|
|
27
|
+
if (err instanceof _redis.default.ReplyError) msg = "".concat((0, _farrapaColors.magenta)('REDIS'), " ").concat((0, _farrapaColors.red)('Error ' + err.code), " Command: ").concat(err.command, " ").concat(err.toString());else msg = "".concat((0, _farrapaColors.magenta)('REDIS'), " ").concat((0, _farrapaColors.red)('Error ' + err.code), " ").concat(err.toString());
|
|
28
28
|
} catch (e) {
|
|
29
|
-
msg = "".concat((0, _farrapaColors.
|
|
29
|
+
msg = "".concat((0, _farrapaColors.magenta)('REDIS'), " ").concat((0, _farrapaColors.red)('Error '), " ").concat(e);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
console.error(msg);
|
package/lib/config/defaults.js
CHANGED
package/lib/db/conn.js
CHANGED
|
@@ -7,9 +7,9 @@ exports.init_db_connection = init_db_connection;
|
|
|
7
7
|
|
|
8
8
|
var {
|
|
9
9
|
getConnection
|
|
10
|
-
} = require('calustra
|
|
10
|
+
} = require('calustra');
|
|
11
11
|
|
|
12
12
|
function init_db_connection(config) {
|
|
13
|
-
var conn = getConnection(config
|
|
13
|
+
var conn = getConnection(config);
|
|
14
14
|
return conn;
|
|
15
15
|
}
|
package/lib/logger/index.js
CHANGED
|
@@ -21,12 +21,12 @@ var {
|
|
|
21
21
|
|
|
22
22
|
var init_logger = (config, emailer) => {
|
|
23
23
|
var LEVEL_COLORS = {
|
|
24
|
-
silly: _farrapaColors.
|
|
25
|
-
debug: _farrapaColors.
|
|
26
|
-
verbose: _farrapaColors.
|
|
27
|
-
info: _farrapaColors.
|
|
28
|
-
warn: _farrapaColors.
|
|
29
|
-
error: _farrapaColors.
|
|
24
|
+
silly: _farrapaColors.gray,
|
|
25
|
+
debug: _farrapaColors.magenta,
|
|
26
|
+
verbose: _farrapaColors.cyan,
|
|
27
|
+
info: _farrapaColors.blue,
|
|
28
|
+
warn: _farrapaColors.yellow,
|
|
29
|
+
error: _farrapaColors.red
|
|
30
30
|
};
|
|
31
31
|
var myFormat = printf(info => {
|
|
32
32
|
var _config$format;
|
|
@@ -89,7 +89,7 @@ var init_logger = (config, emailer) => {
|
|
|
89
89
|
|
|
90
90
|
var logger = createLogger({
|
|
91
91
|
level: (config === null || config === void 0 ? void 0 : config.level) || 'silly',
|
|
92
|
-
format: combine(
|
|
92
|
+
format: combine(errors({
|
|
93
93
|
stack: true
|
|
94
94
|
}), timestamp(), myFormat),
|
|
95
95
|
transports: _log_transports
|
|
@@ -28,9 +28,9 @@ function init_sys_check_and_log(logger) {
|
|
|
28
28
|
var perc = Math.round(used * 100 / total, 2);
|
|
29
29
|
|
|
30
30
|
if (perc > 80) {
|
|
31
|
-
logger.error("[SERVER][".concat((0, _farrapaColors.
|
|
31
|
+
logger.error("[SERVER][".concat((0, _farrapaColors.cyan)('SysCheck'), "] RAM ").concat((0, _farrapaColors.yellow)(used), " MB used of ").concat((0, _farrapaColors.green)(total), " MB (").concat((0, _farrapaColors.yellow)(perc), " %)"));
|
|
32
32
|
} else {
|
|
33
|
-
logger.info("[SERVER][".concat((0, _farrapaColors.
|
|
33
|
+
logger.info("[SERVER][".concat((0, _farrapaColors.cyan)('SysCheck'), "] RAM ").concat((0, _farrapaColors.yellow)(used), " MB used of ").concat((0, _farrapaColors.green)(total), " MB (").concat((0, _farrapaColors.yellow)(perc), " %)"));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
diskspace.check('/', function (err, result) {
|
|
@@ -39,9 +39,9 @@ function init_sys_check_and_log(logger) {
|
|
|
39
39
|
var free = Math.round(toGB(result.free), 2);
|
|
40
40
|
|
|
41
41
|
if (free < 1) {
|
|
42
|
-
logger.error("[SERVER][".concat((0, _farrapaColors.
|
|
42
|
+
logger.error("[SERVER][".concat((0, _farrapaColors.cyan)('SysCheck'), "] DISK ").concat((0, _farrapaColors.yellow)(used), " GB used of ").concat((0, _farrapaColors.green)(total), " MB (").concat((0, _farrapaColors.yellow)(free), " GB free)"));
|
|
43
43
|
} else {
|
|
44
|
-
logger.info("[SERVER][".concat((0, _farrapaColors.
|
|
44
|
+
logger.info("[SERVER][".concat((0, _farrapaColors.cyan)('SysCheck'), "] DISK ").concat((0, _farrapaColors.yellow)(used), " GB used of ").concat((0, _farrapaColors.green)(total), " MB (").concat((0, _farrapaColors.yellow)(free), " GB free)"));
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -34,15 +34,15 @@ function init_socket(logger) {
|
|
|
34
34
|
});
|
|
35
35
|
io.on('connection', function (ctx, _data) {
|
|
36
36
|
var i = getInfo(ctx);
|
|
37
|
-
logger.debug("".concat((0, _farrapaColors.
|
|
37
|
+
logger.debug("".concat((0, _farrapaColors.blue)('SOCKET'), " Connection from ").concat(i.ip, " ").concat(i.id));
|
|
38
38
|
});
|
|
39
39
|
io.on('disconnect', function (ctx, data) {
|
|
40
40
|
var i = getInfo(ctx);
|
|
41
|
-
logger.debug("".concat((0, _farrapaColors.
|
|
41
|
+
logger.debug("".concat((0, _farrapaColors.blue)('SOCKET'), " Disconnected ").concat(i.ip, " ").concat(i.id, " => ").concat(data));
|
|
42
42
|
});
|
|
43
43
|
io.on('error', function (ctx, data) {
|
|
44
44
|
var i = getInfo(ctx);
|
|
45
|
-
logger.error("".concat((0, _farrapaColors.
|
|
45
|
+
logger.error("".concat((0, _farrapaColors.blue)('SOCKET'), " Error on ").concat(i.ip, " ").concat(i.id, " => ").concat(data));
|
|
46
46
|
});
|
|
47
47
|
return io;
|
|
48
48
|
}
|
|
@@ -43,11 +43,11 @@ function init_request_middleware(app) {
|
|
|
43
43
|
|
|
44
44
|
var ip = ctx.headers["x-real-ip"] || '127.0.0.1';
|
|
45
45
|
ctx.request.ip = ip;
|
|
46
|
-
logger.info("req begin ".concat(ctx.requestId, " - ip ").concat(ip, " - ").concat((0, _farrapaColors.
|
|
46
|
+
logger.info("req begin ".concat(ctx.requestId, " - ip ").concat(ip, " - ").concat((0, _farrapaColors.cyan)(ctx.request.method), " ").concat((0, _farrapaColors.cyan)(ctx.request.url), " ").concat(ctx.request.body != undefined ? JSON.stringify(ctx.request.body) : ''));
|
|
47
47
|
yield next();
|
|
48
48
|
var user = (ctx === null || ctx === void 0 ? void 0 : (_ctx$state = ctx.state) === null || _ctx$state === void 0 ? void 0 : _ctx$state.user) || {};
|
|
49
49
|
var elapsed = parseFloat((_perf_hooks.performance.now() - started) / 1000.0).toFixed(2);
|
|
50
|
-
var tcolor = elapsed < 1.0 ? _farrapaColors.
|
|
50
|
+
var tcolor = elapsed < 1.0 ? _farrapaColors.green : elapsed < 2.0 ? _farrapaColors.yellow : _farrapaColors.red;
|
|
51
51
|
logger.info("req end ".concat(ctx.requestId, " ").concat(user ? " - uid ".concat(user.id) : '', " => ").concat(tcolor("DONE in ".concat(elapsed, " seconds"))));
|
|
52
52
|
});
|
|
53
53
|
return _request_middleware.apply(this, arguments);
|
|
@@ -28,7 +28,7 @@ function init_route_catch_js_error(app, route) {
|
|
|
28
28
|
agent
|
|
29
29
|
} = ctx.request.body;
|
|
30
30
|
var logger = ctx.miolo.logger;
|
|
31
|
-
var msg = "".concat((0, _farrapaColors.
|
|
31
|
+
var msg = "".concat((0, _farrapaColors.red)('[JS Error]'), " on ").concat((0, _farrapaColors.blue)(path), ": ").concat(error.msg) + "".concat((0, _farrapaColors.red)('[JS Error]'), " File => ").concat(error.file) + "".concat((0, _farrapaColors.red)('[JS Error]'), " Line => ").concat(error.line) + "".concat((0, _farrapaColors.red)('[JS Error]'), " Col => ").concat(error.col) + "".concat((0, _farrapaColors.red)('[JS Error]'), " Error => ").concat(JSON.stringify(error.error)) + "".concat((0, _farrapaColors.red)('[JS Error]'), " Agent => ").concat(agent);
|
|
32
32
|
logger.error(msg);
|
|
33
33
|
ctx.body = {
|
|
34
34
|
result: 1
|
|
@@ -37,7 +37,7 @@ function init_route_html_render(app, html) {
|
|
|
37
37
|
var method = ctx.request.method;
|
|
38
38
|
var url = ctx.request.url;
|
|
39
39
|
var what = html != undefined ? 'provided html' : 'fallback page';
|
|
40
|
-
logger.info("".concat(reqid, " - ").concat(ip, " : ").concat((0, _farrapaColors.
|
|
40
|
+
logger.info("".concat(reqid, " - ").concat(ip, " : ").concat((0, _farrapaColors.cyan)(method), " ").concat((0, _farrapaColors.cyan)(url), " => Rendering ").concat(what));
|
|
41
41
|
ctx.body = html || indexHTML;
|
|
42
42
|
});
|
|
43
43
|
return _html_render.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miolo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "miolo",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Afialapis <info@afialapis.com>",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
16
16
|
"basic-auth": "^2.0.1",
|
|
17
17
|
"cron": "^1.8.2",
|
|
18
|
-
"calustra
|
|
19
|
-
"calustra-router": "0.0.
|
|
18
|
+
"calustra": "0.0.16",
|
|
19
|
+
"calustra-router": "0.0.16",
|
|
20
20
|
"diskspace": "^2.0.0",
|
|
21
21
|
"eslint": "^8.7.0",
|
|
22
|
-
"farrapa-colors": "^1.0.
|
|
22
|
+
"farrapa-colors": "^1.0.2",
|
|
23
23
|
"koa": "^2.13.4",
|
|
24
24
|
"koa-better-body": "^3.3.9",
|
|
25
25
|
"koa-bodyparser": "^4.3.0",
|
package/src/cacher/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import redis from 'redis'
|
|
2
2
|
import { promisify } from 'util'
|
|
3
|
-
import {
|
|
3
|
+
import { red, magenta } from 'farrapa-colors'
|
|
4
4
|
|
|
5
5
|
function init_cacher(config) {
|
|
6
6
|
|
|
7
7
|
const client = redis.createClient(config.redis.port, config.redis.host)
|
|
8
8
|
.on('connect', function () {
|
|
9
|
-
console.info(`${
|
|
9
|
+
console.info(`${magenta('REDIS')} Connection established!`)
|
|
10
10
|
})
|
|
11
11
|
.on('error', function (err) {
|
|
12
12
|
let msg
|
|
13
13
|
try {
|
|
14
14
|
if (err instanceof redis.ReplyError)
|
|
15
|
-
msg = `${
|
|
15
|
+
msg = `${magenta('REDIS')} ${red('Error ' + err.code)} Command: ${err.command} ${err.toString()}`
|
|
16
16
|
else
|
|
17
|
-
msg = `${
|
|
17
|
+
msg = `${magenta('REDIS')} ${red('Error ' + err.code)} ${err.toString()}`
|
|
18
18
|
} catch(e) {
|
|
19
|
-
msg = `${
|
|
19
|
+
msg = `${magenta('REDIS')} ${red('Error ')} ${e}`
|
|
20
20
|
}
|
|
21
21
|
console.error(msg)
|
|
22
22
|
})
|
package/src/config/defaults.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports= {
|
|
|
30
30
|
idleTimeoutMillis: 10000, // The maximum time, in milliseconds, that a connection can be idle before being released. Use with combination of evict for proper working, for more details read https://github.com/coopernurse/node-pool/issues/178#issuecomment-327110870,
|
|
31
31
|
},
|
|
32
32
|
options: {
|
|
33
|
-
log: '
|
|
33
|
+
log: 'info'
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
routes: {
|
package/src/db/conn.js
CHANGED
package/src/logger/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { red, blue, cyan, magenta, yellow, gray } from 'farrapa-colors'
|
|
2
2
|
/* https://github.com/winstonjs/winston/issues/925 */
|
|
3
3
|
/* https://github.com/winstonjs/winston/issues/287 */
|
|
4
4
|
const { createLogger, format, transports } = require('winston')
|
|
@@ -7,12 +7,12 @@ const { combine, timestamp, _label, printf, errors } = format
|
|
|
7
7
|
|
|
8
8
|
const init_logger = (config, emailer) => {
|
|
9
9
|
const LEVEL_COLORS= {
|
|
10
|
-
silly :
|
|
11
|
-
debug :
|
|
12
|
-
verbose:
|
|
13
|
-
info :
|
|
14
|
-
warn :
|
|
15
|
-
error :
|
|
10
|
+
silly : gray,
|
|
11
|
+
debug : magenta,
|
|
12
|
+
verbose: cyan,
|
|
13
|
+
info : blue,
|
|
14
|
+
warn : yellow,
|
|
15
|
+
error : red
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const myFormat = printf(info => {
|
|
@@ -81,7 +81,7 @@ const init_logger = (config, emailer) => {
|
|
|
81
81
|
const logger = createLogger({
|
|
82
82
|
level: config?.level || 'silly',
|
|
83
83
|
format: combine(
|
|
84
|
-
|
|
84
|
+
errors({ stack: true }),
|
|
85
85
|
timestamp(),
|
|
86
86
|
myFormat
|
|
87
87
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const os = require('os')
|
|
2
2
|
const diskspace = require('diskspace')
|
|
3
|
-
import {
|
|
3
|
+
import { cyan, green, yellow } from 'farrapa-colors'
|
|
4
4
|
|
|
5
5
|
function init_sys_check_and_log(logger) {
|
|
6
6
|
function toMB(bytes) {
|
|
@@ -22,9 +22,9 @@ function init_sys_check_and_log(logger) {
|
|
|
22
22
|
const perc= Math.round( (used*100)/total, 2)
|
|
23
23
|
|
|
24
24
|
if (perc>80) {
|
|
25
|
-
logger.error(`[SERVER][${
|
|
25
|
+
logger.error(`[SERVER][${cyan('SysCheck')}] RAM ${yellow(used)} MB used of ${green(total)} MB (${yellow(perc)} %)`)
|
|
26
26
|
} else {
|
|
27
|
-
logger.info(`[SERVER][${
|
|
27
|
+
logger.info(`[SERVER][${cyan('SysCheck')}] RAM ${yellow(used)} MB used of ${green(total)} MB (${yellow(perc)} %)`)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
|
|
@@ -35,9 +35,9 @@ function init_sys_check_and_log(logger) {
|
|
|
35
35
|
const free = Math.round(toGB(result.free), 2)
|
|
36
36
|
|
|
37
37
|
if (free<1) {
|
|
38
|
-
logger.error(`[SERVER][${
|
|
38
|
+
logger.error(`[SERVER][${cyan('SysCheck')}] DISK ${yellow(used)} GB used of ${green(total)} MB (${yellow(free)} GB free)`)
|
|
39
39
|
} else {
|
|
40
|
-
logger.info(`[SERVER][${
|
|
40
|
+
logger.info(`[SERVER][${cyan('SysCheck')}] DISK ${yellow(used)} GB used of ${green(total)} MB (${yellow(free)} GB free)`)
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import IO from 'koa-socket-2'
|
|
2
|
-
import {
|
|
2
|
+
import { blue } from 'farrapa-colors'
|
|
3
3
|
|
|
4
4
|
function init_socket(logger) {
|
|
5
5
|
|
|
@@ -18,17 +18,17 @@ function init_socket(logger) {
|
|
|
18
18
|
|
|
19
19
|
io.on('connection', function (ctx, _data) {
|
|
20
20
|
const i= getInfo(ctx)
|
|
21
|
-
logger.debug(`${
|
|
21
|
+
logger.debug(`${blue('SOCKET')} Connection from ${i.ip} ${i.id}`)
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
io.on('disconnect', function (ctx, data) {
|
|
25
25
|
const i = getInfo(ctx)
|
|
26
|
-
logger.debug(`${
|
|
26
|
+
logger.debug(`${blue('SOCKET')} Disconnected ${i.ip} ${i.id} => ${data}`)
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
io.on('error', function (ctx, data) {
|
|
30
30
|
const i = getInfo(ctx)
|
|
31
|
-
logger.error(`${
|
|
31
|
+
logger.error(`${blue('SOCKET')} Error on ${i.ip} ${i.id} => ${data}`)
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
return io
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks'
|
|
2
|
-
import {
|
|
2
|
+
import { cyan, green, yellow, red } from 'farrapa-colors'
|
|
3
3
|
|
|
4
4
|
let REQUEST_COUNTER= 1
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ function init_request_middleware(app) {
|
|
|
24
24
|
|
|
25
25
|
ctx.request.ip = ip
|
|
26
26
|
|
|
27
|
-
logger.info(`req begin ${ctx.requestId} - ip ${ip} - ${
|
|
27
|
+
logger.info(`req begin ${ctx.requestId} - ip ${ip} - ${cyan(ctx.request.method)} ${cyan(ctx.request.url)} ${ctx.request.body!=undefined ? JSON.stringify(ctx.request.body) : ''}`)
|
|
28
28
|
|
|
29
29
|
await next()
|
|
30
30
|
|
|
@@ -34,10 +34,10 @@ function init_request_middleware(app) {
|
|
|
34
34
|
const elapsed = parseFloat( (performance.now() - started) / 1000.0 ).toFixed(2)
|
|
35
35
|
|
|
36
36
|
const tcolor= elapsed < 1.0
|
|
37
|
-
?
|
|
37
|
+
? green
|
|
38
38
|
: elapsed < 2.0
|
|
39
|
-
?
|
|
40
|
-
:
|
|
39
|
+
? yellow
|
|
40
|
+
: red
|
|
41
41
|
|
|
42
42
|
logger.info(`req end ${ctx.requestId} ${user ? ` - uid ${user.id}` : ''} => ${tcolor(`DONE in ${elapsed} seconds`)}`)
|
|
43
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { blue, red } from 'farrapa-colors'
|
|
2
2
|
import Router from '@koa/router'
|
|
3
3
|
|
|
4
4
|
function init_route_catch_js_error(app, route) {
|
|
@@ -8,12 +8,12 @@ function init_route_catch_js_error(app, route) {
|
|
|
8
8
|
const logger = ctx.miolo.logger
|
|
9
9
|
|
|
10
10
|
const msg=
|
|
11
|
-
`${
|
|
12
|
-
`${
|
|
13
|
-
`${
|
|
14
|
-
`${
|
|
15
|
-
`${
|
|
16
|
-
`${
|
|
11
|
+
`${red('[JS Error]')} on ${blue(path)}: ${error.msg}` +
|
|
12
|
+
`${red('[JS Error]')} File => ${error.file}` +
|
|
13
|
+
`${red('[JS Error]')} Line => ${error.line}` +
|
|
14
|
+
`${red('[JS Error]')} Col => ${error.col}` +
|
|
15
|
+
`${red('[JS Error]')} Error => ${JSON.stringify(error.error)}` +
|
|
16
|
+
`${red('[JS Error]')} Agent => ${agent}`
|
|
17
17
|
|
|
18
18
|
logger.error(msg)
|
|
19
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import fs from 'fs'
|
|
3
3
|
import { resolve } from 'path'
|
|
4
|
-
import {
|
|
4
|
+
import { cyan } from 'farrapa-colors'
|
|
5
5
|
import Router from '@koa/router'
|
|
6
6
|
|
|
7
7
|
const indexHTMLPath= resolve(__dirname, 'fallback_index.html')
|
|
@@ -20,7 +20,7 @@ function init_route_html_render(app, html) {
|
|
|
20
20
|
const what = html!=undefined
|
|
21
21
|
? 'provided html'
|
|
22
22
|
: 'fallback page'
|
|
23
|
-
logger.info(`${reqid} - ${ip} : ${
|
|
23
|
+
logger.info(`${reqid} - ${ip} : ${cyan(method)} ${cyan(url)} => Rendering ${what}`)
|
|
24
24
|
|
|
25
25
|
ctx.body = html || indexHTML
|
|
26
26
|
}
|