mirror of
https://github.com/janoside/btc-rpc-explorer.git
synced 2026-08-13 12:33:13 +02:00
minor tweaks
This commit is contained in:
parent
681b531b42
commit
a88cea557e
4 changed files with 31 additions and 2 deletions
8
app.js
8
app.js
|
|
@ -843,8 +843,14 @@ if (expressApp.get("env") === "local") {
|
|||
expressApp.use(function(req, res, next) {
|
||||
var time = Date.now() - req.startTime;
|
||||
var userAgent = req.headers['user-agent'];
|
||||
var crawler = utils.getCrawlerFromUserAgentString(userAgent);
|
||||
|
||||
if (crawler) {
|
||||
debugAccessLog(`Finished action '${req.path}' (${res.statusCode}) in ${time}ms for crawler '${crawler}' / '${userAgent}'`);
|
||||
|
||||
debugAccessLog(`Finished action '${req.path}' (${res.statusCode}) in ${time}ms for UA '${userAgent}'`);
|
||||
} else {
|
||||
debugAccessLog(`Finished action '${req.path}' (${res.statusCode}) in ${time}ms for UA '${userAgent}'`);
|
||||
}
|
||||
|
||||
if (!res.headersSent) {
|
||||
next();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ const crawlerBotUserAgentStrings = {
|
|||
"facebook": new RegExp("facebot", "i"),
|
||||
"alexa": new RegExp("ia_archiver", "i"),
|
||||
"aol": new RegExp("aolbuild", "i"),
|
||||
"moz.com": new RegExp("dotbot", "i"),
|
||||
"moz": new RegExp("dotbot", "i"),
|
||||
"semrush": new RegExp("SemrushBot", "i")
|
||||
};
|
||||
|
||||
const ipMemoryCache = {};
|
||||
|
|
|
|||
21
bin/test.js
Normal file
21
bin/test.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const utils = require("../app/utils.js");
|
||||
|
||||
console.log("test");
|
||||
|
||||
global.activeBlockchain = "main";
|
||||
|
||||
|
||||
|
||||
(async () => {
|
||||
const perfResults = {};
|
||||
|
||||
await utils.timePromise("abc", async () => {
|
||||
const x = utils.estimatedSupply(4802177);
|
||||
console.log("xxx: " + x);
|
||||
|
||||
}, perfResults);
|
||||
|
||||
console.log("perfResults: " + JSON.stringify(perfResults));
|
||||
|
||||
process.exit(0);
|
||||
})();
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
"bin": "bin/cli.js",
|
||||
"scripts": {
|
||||
"start": "node ./bin/www",
|
||||
"test": "node ./bin/test.js",
|
||||
"miners": "node ./bin/refresh-mining-pool-configs.js",
|
||||
"integrity": "node ./bin/frontend-resource-integrity.js",
|
||||
"css-light-debug": "node-sass --output-style expanded --source-map scss --precision 6 ./public/scss/light.scss ./public/style/light.css",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue