This repository has been archived by the owner on Dec 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dc03a9
commit d969492
Showing
2 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,9 @@ | |
"title": "OpenRCT2", | ||
"description": null, | ||
"publicUrl": "http://localhost:5000", | ||
"forumsPublicUrl": "https://forums.openrct2.org" | ||
"forumsPublicUrl": "https://forums.openrct2.org", | ||
"author": { | ||
"name": "OpenRCT2 Webmaster", | ||
"emailAddress": "[email protected]" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,16 +17,18 @@ import {AltApiRouter} from './routes/altapi.js'; | |
import {Log} from '../utils/log.js'; | ||
import {VersionUtils} from '../utils/version.js'; | ||
|
||
Eta.configure({ | ||
cache: true, | ||
rmWhitespace: true, | ||
}); | ||
|
||
/** | ||
* @typedef {import('node:http').Server} NodeHTTPServer | ||
*/ | ||
|
||
export default class HTTPServer { | ||
static { | ||
Eta.configure({ | ||
cache: true, | ||
rmWhitespace: true, | ||
}); | ||
} | ||
|
||
/** | ||
* @type {HTTPServer} | ||
*/ | ||
|
@@ -110,22 +112,21 @@ export default class HTTPServer { | |
application.set('view engine', 'eta'); | ||
application.set('views', './views'); | ||
|
||
const siteConfig = Config.get('site'); | ||
|
||
// Set site global | ||
application.locals.site = { | ||
title: Config.get('site')['title'], | ||
description: Config.get('site')['description'], | ||
publicUrl: Config.get('site')['publicUrl'], | ||
title: siteConfig['title'], | ||
description: siteConfig['description'], | ||
publicUrl: siteConfig['publicUrl'], | ||
version: VersionUtils.getVersion(), | ||
}; | ||
|
||
// Set frontend entrypoint global | ||
application.locals.frontendEntrypoints = await HTTPServer.#getFrontendBundles(); | ||
|
||
// Set author global | ||
application.locals.author = { | ||
name: 'OpenRCT2 Webmaster', | ||
emailAddress: '[email protected]', | ||
}; | ||
application.locals.author = siteConfig['author']; | ||
} | ||
|
||
/** | ||
|
@@ -345,3 +346,5 @@ export default class HTTPServer { | |
}); | ||
} | ||
} | ||
|
||
export {Router}; |