0
0
mirror of https://github.com/sp-tarkov/db-website.git synced 2025-02-02 17:49:21 -05:00

Fixed not being able to serve react app

This commit is contained in:
TheSparta 2024-04-08 14:34:49 +01:00
parent 79e4169658
commit 79fda074fb
2 changed files with 3 additions and 4 deletions

View File

@ -15,8 +15,6 @@ export class CacheController {
const items = CacheService.getCache("items"); const items = CacheService.getCache("items");
const locales = CacheService.getCache("locales"); const locales = CacheService.getCache("locales");
console.log(items, locales);
const searchInput = query.toLowerCase().trim(); const searchInput = query.toLowerCase().trim();
const locale = locales[localeId]; const locale = locales[localeId];

View File

@ -18,10 +18,11 @@ new Elysia()
} }
})) }))
.use(cors({ allowedHeaders: "Origin, X-Requested-With, Content-Type, Accept" })) .use(cors({ allowedHeaders: "Origin, X-Requested-With, Content-Type, Accept" }))
.use(staticPlugin({ prefix: "/", alwaysStatic: true })) .use(staticPlugin({ prefix: "/", indexHTML: true }))
.use(Logestic.preset("fancy")) .use(Logestic.preset("fancy"))
.use(api) .use(api)
.get("*", () => Bun.file("public/index.html")) .get("/search", () => Bun.file("public/index.html"))
.get("/search/*", () => Bun.file("public/index.html"))
.listen(3000, (server) => { .listen(3000, (server) => {
console.log(`Server is running at ${server.hostname}:${server.port}`); console.log(`Server is running at ${server.hostname}:${server.port}`);
}); });