This commit is contained in:
Enstrayed
2024-08-17 11:04:58 -07:00
parent 8515490a07
commit 86224d00e3
3 changed files with 46 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ function criticalFileLoader(file) {
const globalConfig = JSON.parse(criticalFileLoader('config.json'))
const globalVersion = criticalFileLoader('GITVERSION').split(" ")[0]
module.exports = { app, globalConfig, fs } // Export express app and fs objects and globalconfig
module.exports = { app, globalConfig, fs, globalVersion } // Export express app and fs objects and globalconfig
app.use(express.json()) // Allows receiving JSON bodies
// see important note: https://expressjs.com/en/api.html#express.json
@@ -39,9 +39,5 @@ fs.readdir(globalConfig.startup.routesDir, (err, files) => {
}
})
app.get("/", (rreq,rres) => {
rres.send(`Enstrayed API | Version: ${globalVersion} | Documentation: <a href="https://etyd.cc/apidocs">etyd.cc/apidocs</a>`)
})
console.log(`Enstrayed API | Version: ${globalVersion} | Port: ${globalConfig.startup.apiPort}`)
app.listen(globalConfig.startup.apiPort)