Noob question - How to read .db file in production?
Hi!
I'm working on a website that displays products based on a sqlite .db file.
It works in dev mode but after deploying the pages can't seem to access the .db file.
How i've set it up:
.db file is placed in /data folder
API performs sql query on .db file and returns necessary data for display:
Initially it worked on dev but didn't work when I ran "npm run build" and then "npm run preview".
I realised that somehow the .db file wasn't included in the .output folder. So I added a script to manually copy and paste the data folder with the .db file to the .output folder.
And edited the "build" script in package.json to run this on npm run build after nuxt build
After making these changes, everything worked when i previewed with npm run preview
However, when I deployed it to cloudflare pages it doesn't work.
I feel like I'm missing something? I'm just trying to read and display a .db file.
0 Replies