Backend API
Backend API for a CFP community platform project developed by www.connecta.dev
-
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).
If you want to install the latest version of NodeJS in Ubuntu, please see the following steps:
$ curl -s https://deb.nodesource.com/setup_16.x | sudo bash
$ sudo apt install nodejs -y
$ node -v
$ curl -L https://npmjs.org/install.sh | sudo sh
$ npm -v
-
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: 0.1.0
- License: MIT
- Chris Mazur / mate.dev