Fix: Stable Prisma 6 setup, database seeding, and routing improvements
This commit is contained in:
1 parent
eed1ef4266
commit
108184ba68
8 files changed
+680
-868
No files matched your search
Generated
+601
-850
File diff suppressed because it is too large.
Load diff
@@ -13,16 +13,19 @@
|
||||
"license": "ISC",
|
||||
"type": "commonjs",
|
||||
"dependencies": {
|
||||
"@prisma/client": "^7.8.0",
|
||||
"@prisma/adapter-better-sqlite3": "^7.8.0",
|
||||
"@prisma/client": "^6.19.3",
|
||||
"better-sqlite3": "^12.10.0",
|
||||
"cors": "^2.8.6",
|
||||
"dotenv": "^17.4.2",
|
||||
"express": "^5.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/better-sqlite3": "^7.6.13",
|
||||
"@types/cors": "^2.8.19",
|
||||
"@types/express": "^5.0.6",
|
||||
"@types/node": "^25.9.1",
|
||||
"prisma": "^7.8.0",
|
||||
"prisma": "^6.19.3",
|
||||
"ts-node-dev": "^2.0.0",
|
||||
"typescript": "^6.0.3"
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// This file was generated by Prisma, and assumes you have installed the following:
|
||||
// npm install --save-dev prisma dotenv
|
||||
import "dotenv/config";
|
||||
import { defineConfig } from "prisma/config";
|
||||
|
||||
export default defineConfig({
|
||||
schema: "prisma/schema.prisma",
|
||||
migrations: {
|
||||
path: "prisma/migrations",
|
||||
},
|
||||
datasource: {
|
||||
url: process.env["DATABASE_URL"],
|
||||
},
|
||||
});
|
||||
@@ -7,6 +7,7 @@ generator client {
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model StockItem {
|
||||
|
||||
@@ -159,8 +159,7 @@ app.post('/api/reset', async (req, res) => {
|
||||
const frontendPath = path.join(__dirname, '../../frontend/dist');
|
||||
app.use(express.static(frontendPath));
|
||||
|
||||
app.get('*', (req, res) => {
|
||||
if (req.path.startsWith('/api')) return;
|
||||
app.get(/^\/(?!api).*/, (req, res) => {
|
||||
res.sendFile(path.join(frontendPath, 'index.html'));
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user