0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-23 19:38:12 +00:00

trying to get this to work

This commit is contained in:
Víctor Losada Hernández
2026-02-01 20:37:09 +01:00
parent 215d24b99a
commit b5598ac423
9 changed files with 65 additions and 66 deletions

View File

@@ -8,7 +8,6 @@ const isProd = process.env.NODE_ENV === "production";
async function start() {
let vite;
//==== Create Vite dev server only in development ====//
if (!isProd) {
vite = await createViteServer({
server: { middlewareMode: true },
@@ -17,16 +16,13 @@ async function start() {
}
//==== Connect to the database ====//
await DB.connect(config).catch((err) => {
console.error("Database connection failed:", err);
process.exit(1);
});
//==== Create the Express app ====//
const app = await createApp(vite);
//==== Start listening ====//
const PORT = process.env.PORT || config.get("web_port") || 8000;
app.listen(PORT, () => {
const reset = "\x1b[0m"; // Reset to default style
@@ -42,5 +38,4 @@ async function start() {
});
}
//==== Start the server ====//
start();