Closed mtshikomba closed 3 years ago
Hi @dev-mtshikomba have you run npm install
?
Also you need to have MongoDB Compass Community installed locally on your machine and create a database with the name votenamibia, or you can still connect to mongoDB through your account if you have
To connect MongoDB remote bellow is the code
DATABASE=mongodb+srv://<yourusername>:<PASSWORD>@cluster0-bev59.mongodb.net/votenamibia ?retryWrites=true&w=majority DATABASE_PASSWORD=<PASSWORD>
To Connect locally
DATABASE_LOCAL=mongodb://localhost:27017/votenamibia
That's all
Create a config.env file and add the following
`APP_NAME=VoteNamibia NODE_ENV=development PORT=3000
DATABASE_PASSWORD=
JWT_SECRET=never-
EMAIL_USERNAME=mailtrapusername EMAIL_PASSWORD=mailtrappassword EMAIL_HOST=smtp.mailtrap.io EMAIL_PORT=25`
You need the above config.env in order to run it locally
I've run npm install
, I should create the config.env
file in the root directory right? See Image below...
I installed MongoDB locally in a docker image running at port 8081. See Image below.
Thats mongodb connection error, but can you connect to it with other apps that you may have worked on, if you are already connected to it through another app than I think you have to use the same method
And again don't forget to setup your mailing configuration, you need to do sign in if you want to add some testing data to the database
But the setup seems to be fine, thats all you need to run it locally
Also you need to expose your port to mongo by running mongo --port 8081 in your terminal
Perfect this worked. I've added a Docker Image for MongoDB and Mongo Express to the project. I'll submit a pull request shortly.
But I used the default port instead, just for consistency.
Great is it working now?
Not sure what is causing the error below but whenever I do
$ npm run dev
OR$ npm run start
it pops up and I can't do anything else. I am using Ubuntu 16.04.Here is my npm and node version not sure if it has anything to do with this but i had to upgrade from an earlier: