fix: disable legacy server-side JavaScript in webroot by default in YAML-format confi...
[svrjs.git] / src / utils / generateServerString.js
blob4ea60ba8835ca20eccf5282e6928d0bab2f43402
1 const svrjsInfo = require("../../svrjs.json");
2 const { version, name } = svrjsInfo;
3 const getOS = require("./getOS.js");
5 function generateServerString(exposeServerVersion) {
6 return exposeServerVersion
7 ? `${name.replace(/ /g, "-")}/${version} (${getOS()}; ${
8 process.isBun
9 ? "Bun/v" + process.versions.bun + "; like Node.js/" + process.version
10 : process.versions && process.versions.deno
11 ? "Deno/v" +
12 process.versions.deno +
13 "; like Node.js/" +
14 process.version
15 : "Node.js/" + process.version
16 })`
17 : name.replace(/ /g, "-");
20 module.exports = generateServerString;