refactor(server): added in ability to listen on all ip's
This commit is contained in:
@@ -15,8 +15,19 @@ import tcpServer from "./services/tcpServer/tcpServer.js";
|
|||||||
import ocme from "./services/ocme/ocmeService.js";
|
import ocme from "./services/ocme/ocmeService.js";
|
||||||
import sqlService from "./services/sqlServer/sqlService.js";
|
import sqlService from "./services/sqlServer/sqlService.js";
|
||||||
import logistics from "./services/logistics/logisticsService.js";
|
import logistics from "./services/logistics/logisticsService.js";
|
||||||
|
import {db} from "../database/dbclient.js";
|
||||||
|
import {settings} from "../database/schema/settings.js";
|
||||||
|
import {eq} from "drizzle-orm";
|
||||||
|
|
||||||
const allowedOrigins = ["http://localhost:3000", "http://localhost:4000", "http://localhost:5173"];
|
// plant token
|
||||||
|
const dbServer = await db.select().from(settings).where(eq(settings.name, "dbServer"));
|
||||||
|
const serverPort = await db.select().from(settings).where(eq(settings.name, "serverPort"));
|
||||||
|
const allowedOrigins = [
|
||||||
|
"http://localhost:3000",
|
||||||
|
"http://localhost:4000",
|
||||||
|
"http://localhost:5173",
|
||||||
|
`http://usmcd1vms006:4000`,
|
||||||
|
];
|
||||||
const app = new OpenAPIHono();
|
const app = new OpenAPIHono();
|
||||||
|
|
||||||
// middle ware
|
// middle ware
|
||||||
@@ -110,9 +121,10 @@ serve(
|
|||||||
{
|
{
|
||||||
fetch: app.fetch,
|
fetch: app.fetch,
|
||||||
port: Number(process.env.VITE_SERVER_PORT),
|
port: Number(process.env.VITE_SERVER_PORT),
|
||||||
|
hostname: "0.0.0.0",
|
||||||
},
|
},
|
||||||
(info) => {
|
(info) => {
|
||||||
createLog("info", "LST", "server", `Server is running on http://localhost:${info.port}`);
|
createLog("info", "LST", "server", `Server is running on http://${info.address}:${info.port}`);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user