1
mirror of https://github.com/thepeacockproject/Peacock synced 2025-02-23 03:35:25 +01:00
This commit is contained in:
Reece Dunham 2022-11-28 12:41:39 -05:00
commit 51303d2adb
No known key found for this signature in database
GPG Key ID: 0D7E929D2089E040

View File

@ -125,6 +125,20 @@ const app = express()
app.use(loggingMiddleware)
app.use("/_wf", webFeaturesRouter)
app.get("/", (req: Request, res) => {
if (PEACOCK_DEV) {
res.send("dev active, you need to access the UI from port 3000")
} else {
const data = readFileSync("webui/dist/index.html").toString()
res.contentType("text/html")
res.send(data)
}
})
serveStatic.mime.define({ "application/javascript": ["js"] })
app.use("/assets", serveStatic("webui/dist/assets"))
// make sure all responses have a default content-type set
app.use(function (_req, res, next) {
res.contentType("text/plain")
@ -136,18 +150,6 @@ if (getFlag("loadoutSaving") === "PROFILES") {
app.use("/loadouts", loadoutRouter)
}
app.get("/", (req: Request, res) => {
if (PEACOCK_DEV) {
res.send("dev active, you need to access the UI from port 3000")
} else {
const data = readFileSync("webui/dist/index.html").toString()
res.send(data)
}
})
app.use("/assets", serveStatic("webui/dist/assets"))
app.get(
"/config/:audience/:serverVersion(\\d+_\\d+_\\d+)",
(req: RequestWithJwt<{ issuer: string }>, res) => {