Site refreshes after i INSERT a DB Entry #10732
Unanswered
DevKame
asked this question in
Help/Questions
Replies: 1 comment 5 replies
-
The bigger problem here is that you have your backend source code in the /public folder, which means it gets moved to your /dist folder when you build your vue app. When you then deploy. Your Vue app from the /dist folder, you have now exposed your backend source code to everyone on the internet. Move your backend out of there!! That will likely also fix your problem |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In one of my components you can create a developer:
The development server validates those entries and creates a new row in my kman.db (using Python / Flask and Pythons sqlite3 module)
Whenever i send a post request to the server and after creation within the database, my site refreshes. I commented the part of the actual creation within the database out and there were no refreshes, so after looking for this reason for hours i am about to think the following: i use Vue CLI, whenever i change something within my project, the site refreshes. Is it possible that, with every new entry, the kman.db is updated, Vue notices those updating and invokes this refreshing based on that? If so, after quick researching, i looke for a solution to exclude any files from webpack and found this:
I have to create a webpack.config.js with the following content:
But no changes happened. For testing i do both, creating a new entry within my app aswell as manually deleting entries from kman.db by using the VSCode extension "SQLite3 Editor" by yy0931. In both cases, a refresh happens.
Then i tried adding this code to the already existing "vue.config.js" what made it look like this:
But also this does not help, i tried to change the value from /kman.db/ to ""*/kman.db", aswell as "./public/backend/kman.db", within both, vue.config.js and webpack.config.js, but still getting refreshes.
What could cause a refresh guys im so exhausted by now and out of ideas.
Key-points:
Just in case here is the code of my backend:
Flask-Server server.py:
developer.py:
This is what the folder structure looks like:
I dont know why but im so convinced that i have to remove kman.db from the "watching process" of vue but i may be wrong. LEt me know if you need any background info!!
Beta Was this translation helpful? Give feedback.
All reactions