change config

This commit is contained in:
lucasdevelop 2021-08-07 17:37:57 +02:00
parent d01f9fb233
commit 1d7b951a10
2 changed files with 17 additions and 3 deletions

View File

@ -1,5 +1,19 @@
let config = {
let config = {};
let configvar = {
templatePath: __dirname + "\\src\\templates",
pagePath: __dirname + "\\src\\pages",
};
config.get = function (key) {
return configvar[key];
};
config.getConfig = function () {
return configvar;
};
config.set = function (key, value) {
configvar[key] = value;
};
module.exports = config;

View File

@ -3,8 +3,8 @@ const fs = require("fs");
//let appdir = path.join(__dirname, "..");
let app = {};
app.config = require("./config");
app.__config = require("./config")
app.config = app.__config.getConfig();
function escapeRegExp(string) {
return string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");