feat: changes for deploy
This commit is contained in:
@@ -16,3 +16,14 @@ All the interface must be protected under authentication EXCEPT for the GET /api
|
||||
|
||||
## Compilation and deployment
|
||||
|
||||
Compile:
|
||||
|
||||
```
|
||||
./node_modules/vite build
|
||||
```
|
||||
|
||||
Run:
|
||||
|
||||
```
|
||||
NODE_ENV=production HTTP_PORT=1234 node ./src/server/main.ts
|
||||
```
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + React + TS</title>
|
||||
<title>owof Announcements</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
+13
-13
@@ -10,6 +10,17 @@
|
||||
"biome-full": "biome check --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^12.11.1",
|
||||
"express": "^5.1.0",
|
||||
"kysely": "^0.29.2",
|
||||
"multer": "^2.2.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"tsx": "^4.19.3",
|
||||
"vite-express": "*",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@fontsource/raleway": "5.2.8",
|
||||
@@ -21,19 +32,6 @@
|
||||
"@tanstack/react-router": "^1.170.16",
|
||||
"@tanstack/react-router-devtools": "^1.167.0",
|
||||
"@tanstack/router-core": "^1.170.0",
|
||||
"better-sqlite3": "^12.11.1",
|
||||
"date-fns": "^4.4.0",
|
||||
"express": "^5.1.0",
|
||||
"kysely": "^0.29.2",
|
||||
"multer": "^2.2.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"tsx": "^4.19.3",
|
||||
"typescript": "^5.8.3",
|
||||
"vite-express": "*",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "2.5.0",
|
||||
"@tanstack/router-plugin": "^1.168.18",
|
||||
"@types/express": "^5.0.1",
|
||||
@@ -42,7 +40,9 @@
|
||||
"@types/react": "^19.1.2",
|
||||
"@types/react-dom": "^19.1.2",
|
||||
"@vitejs/plugin-react": "^4.4.1",
|
||||
"date-fns": "^4.4.0",
|
||||
"nodemon": "^3.1.10",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -4,7 +4,7 @@ import express from "express";
|
||||
import multer from "multer";
|
||||
import ViteExpress from "vite-express";
|
||||
import z from "zod";
|
||||
import { db } from "./db/database.js";
|
||||
import { db } from "./db/database.ts";
|
||||
|
||||
const baseUploadsFolder = "uploads/";
|
||||
|
||||
@@ -131,6 +131,7 @@ app.delete("/api/announcements/:announcementId", async (req, res) => {
|
||||
|
||||
app.use("/images", express.static(baseUploadsFolder));
|
||||
|
||||
ViteExpress.listen(app, 3000, () =>
|
||||
console.log("Server is listening on port 3000..."),
|
||||
const httpPort = parseInt(process.env.HTTP_PORT ?? "3000", 10);
|
||||
ViteExpress.listen(app, httpPort, () =>
|
||||
console.log(`Server is listening on port ${httpPort}...`),
|
||||
);
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@
|
||||
"moduleResolution": "NodeNext",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true
|
||||
"noEmit": true,
|
||||
"allowImportingTsExtensions": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user