refactor(ocme): moved the server port to the app vs ocme
This commit is contained in:
@@ -189,6 +189,7 @@ const port =
|
||||
? process.env.VITE_SERVER_PORT
|
||||
: process.env.PROD_PORT;
|
||||
|
||||
const ocmeport = process.env.OCME_PORT;
|
||||
serve(
|
||||
{
|
||||
fetch: app.fetch,
|
||||
@@ -205,4 +206,27 @@ serve(
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Only for ocme until we get them switched over to the single port setup.
|
||||
*/
|
||||
const setting = await db.select().from(settings);
|
||||
const isActive = setting.filter((n) => n.name === "ocmeService");
|
||||
if (ocmeport && isActive[0]?.value === "1") {
|
||||
serve(
|
||||
{
|
||||
fetch: app.fetch,
|
||||
port: Number(ocmeport),
|
||||
hostname: "0.0.0.0",
|
||||
},
|
||||
(info) => {
|
||||
createLog(
|
||||
"info",
|
||||
"LST",
|
||||
"server",
|
||||
`Ocme section is listening on http://${info.address}:${info.port}`
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export type AppRoutes = typeof appRoutes;
|
||||
|
||||
Reference in New Issue
Block a user