You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fork this repo to your account then clone it to your folder - OR - just download as a zip, and it comes without any .git folder, so it doesnt messes up your existing folder.
run npm install
if you dont want some server-template git repo related stuff to appear in your package.json file, just delete the original package.json and then run sh init.sh from terminal, it will create package.json and install nessesary npm packeges. If you want to use nodemon with the npm start command, you have to add the start scritp to packeges.json ("start": "nodemon server.js")
check if nodemon have been installed as well, if not, install it manually
Set your database credentials in the .env file and add .env to the .gitignore - now your database should work just fine
now you can check your backend server with npm start command, or normally with nodmeon
Feel free to check out the snippets folder for additional code snippets.
Bear in mind, that this is a mere spine of a server, you have to give it functionality.
Update notes
backend.js is now not async as Peter corrected
sry for any typo
About
This is a basic express server template to not to create everything manually every time