Make config.json, Make webserver respect config.
continuous-integration/drone/push Build is passing Details

main
nightly 2022-10-20 09:07:07 +02:00
parent f9238bd2c1
commit 3fa2df5bd0
5 changed files with 38 additions and 5 deletions

View File

@ -29,7 +29,7 @@ export function startWebserver(config: any) {
}); });
if (config) { if (config) {
console.log("test"); console.log(config.port);
} }
// View engine options // View engine options
@ -50,7 +50,7 @@ export function startWebserver(config: any) {
else res.status(404).type("txt").send("404"); else res.status(404).type("txt").send("404");
}); });
app.listen(3430, "0.0.0.0", () => { app.listen(config.port, "0.0.0.0", () => {
console.log("Webserver running on port 3430"); console.log("Webserver running on port 3430");
}); });
} }

View File

@ -1,5 +1,5 @@
<!-- Page title --> <!-- Page title -->
{% assign pageTitle = "boom" %} {% assign pageTitle = "MangoRecipe" %}
<!-- Metadata tagline --> <!-- Metadata tagline -->

View File

@ -6,6 +6,6 @@ export class MangoRecipe {
// Starts webservers at first boot // Starts webservers at first boot
constructor() { constructor() {
this.config = config; this.config = config;
startWebserver(this); startWebserver(config.webapp);
} }
} }

17
config.example.json Normal file
View File

@ -0,0 +1,17 @@
{
"defaultLocale": "en",
"webapp": {
"cookieSecure": false,
"port": 6000,
"redirectURI": "http://localhost:6000/auth/callback"
},
"database": {
"db": "mangorecipe",
"host": "",
"password": "",
"port": 5432,
"user": ""
}
}

View File

@ -1 +1,17 @@
{} {
"defaultLocale": "en",
"webapp": {
"cookieSecure": false,
"port": 3440,
"redirectURI": "http://localhost:6000/auth/callback"
},
"database": {
"db": "mangorecipe",
"host": "",
"password": "",
"port": 5432,
"user": ""
}
}