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I,YACf,MAAM,IAAI,cAClB,GACJ","file":"/npm/@humansareweak/lightweight-framework@1.1.4/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@humansareweak/lightweight-framework@1.1.4/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\r\n/**\r\n *   [Main Index File]\r\n *   This file is mainly used for pre configure everything and to return\r\n *   the desired Classes for Inheritance\r\n */\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Controller_1 = __importDefault(require(\"./Core/Controller\"));\r\nvar Router_1 = __importDefault(require(\"./Core/System/Router\"));\r\n/**\r\n * [Variable Section]\r\n * Some constant variables are created here\r\n * that are used to be passed around.\r\n */\r\nvar express = require(\"express\");\r\nvar app = express();\r\nvar router = new Router_1.default(app);\r\nvar chalk = require(\"chalk\");\r\nvar internalIp = require(\"internal-ip\");\r\nvar cors = require(\"cors\");\r\nvar fs = require(\"fs\");\r\nrequire(\"dotenv\").config();\r\n/**\r\n *   [Exports Section]\r\n *   Exports everything that needs to be exported\r\n */\r\nexports.Controller = Controller_1.default;\r\nexports.Router = router;\r\nmodule.exports.StartUp = function (params) {\r\n    if (!params.port)\r\n        params.port = 4001;\r\n    if (params.env == \"development\") {\r\n        app.use(cors());\r\n    }\r\n    Router_1.default.path = params.path.replace(/\\\\/g, \"/\");\r\n    require(params.path + \"/Web/Routes.js\");\r\n    app.get(\"*\", function (req, res) {\r\n        if (!res.headersSent) {\r\n            res.status(404).send(JSON.stringify({\r\n                status: 404,\r\n                message: \"The page you are looking for was not found.\",\r\n            }));\r\n        }\r\n    });\r\n    if (params.publicFolder) {\r\n        if (fs.existsSync(params.path + \"../\" + params.publicFolder)) {\r\n            fs.mkdirSync(params.publicFolder);\r\n        }\r\n        app.use(express.static(params.publicFolder));\r\n    }\r\n    app.listen(params.port, function () {\r\n        console.clear();\r\n        console.log(chalk.blue(\"[Lightweight Framework]\") +\r\n            \"\\n\\n\" +\r\n            \"[Project] \" +\r\n            chalk.green(params.name) +\r\n            \"\\n\" +\r\n            \"[Status] \" +\r\n            chalk.green(\"Server started\") +\r\n            \"\\n\" +\r\n            \"[Local] \" +\r\n            chalk.yellow(\"http://localhost:\" + params.port + \"/\") +\r\n            \"\\n\" +\r\n            \"[Network] \" +\r\n            chalk.yellow(\"http://\" + internalIp.v4.sync() + \":\" + params.port + \"/\") +\r\n            \"\\n\\n\" +\r\n            chalk.red(\"To Stop the Server, press \") +\r\n            chalk.bold.red(\"CTRL + C\") +\r\n            chalk.red(\" (Windows)\"));\r\n    });\r\n};\r\n"]}