Storage service for hostify
This is the backend for upload and storage packages in hostify.
Requirements
- heroku account
- MongoDB Atlas account
Preparing
- Create a cluster in MongoDB Atlas. An M0 group is sufficient in most cases.
- Create a database user in Atlas. They must have the database read and write permission.
- Get the connection string from the database and insert the username and password of the created one. It should look something like this:
mongodb+srv://username:password@zyxwvu.fedcba.mongodb.net@cluster0.ssezy.mongodb.net/hostifypackagedb?retryWrites=true&w=majority
. - Save this connection string in heroku Config Vars with name
MONGODB_URI
and value keyMongoURI
. - create an environment variable called
SECRET_JWT
and add your JWT token
Deploy
- Install
heroku
CLI. - Sign in to
heroku
and created your dyno cluster
then run the command
git push heroku master
note: remember to have the aforementioned environment variables already configured before deploy the application
Development
To run the backend locally, make sure you have node js and mongoDB compass installed. Then run:
npm run dev