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) {
console.log("test");
console.log(config.port);
}
// View engine options
@ -50,7 +50,7 @@ export function startWebserver(config: any) {
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");
});
}

View File

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

View File

@ -6,6 +6,6 @@ export class MangoRecipe {
// Starts webservers at first boot
constructor() {
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": ""
}
}