Backend API
Backend API for a community platform project
-
Install Docker.
-
Open a command prompt.
-
Run the commands listed in
node.dockerfile
(see the comments at the top of the file). -
Navigate to http://localhost:5000 or use Postman/Insomia to connect with the api.
-
Install Docker.
-
Open a command prompt at the root of the application's folder.
-
Run
docker-compose build
-
Run
docker-compose up
-
Open another command prompt and run
docker ps -a
and note the ID of the Node container -
Run
docker exec -it <nodeContainerID> sh
(replace with the proper ID) to sh into the container -
Run
node seeder.js
to seed the MongoDB database -
Type
exit
to leave the sh session -
Navigate to http://localhost:5000 or use Postman/Insomia.
-
Run
docker-compose down
to stop the containers and remove them.
-
Register in https://account.mongodb.com
-
Install the LTS version of Node.js (http://nodejs.org).
-
Open
config/config.env.env
and adjust the values/setting to your own. Rename "config/config.env.env" to "config/config.env". -
Install Dependencies. Run
npm install
. -
Run
node seeder.js
to get the sample data loaded into MongoDB. Exit the command prompt. -
Run App
Run npm run dev
to start the server in dev mode.
Run npm start
to start the server in prod mode.
- Navigate to http://localhost:5000 or use Postman/Insomia.
- Version: 1.0.0
- License: MIT