-
Notifications
You must be signed in to change notification settings - Fork 0
Backend
Mohammadreza Amini edited this page Jul 28, 2021
·
2 revisions
REST API written in Node.js using the Express.js web application framework and MongoDB for our database.
Other services used include:
- MongoDB Atlas for MongoDB database hosting.
Create .env file in the Backend folder with this content:
DB_URL="mongodb+srv://user:password@server"To run the backend you have 2 choices:
To run the docker container you have 2 choices:
Build docker container:
docker build -t safe-crossing-backend .Run docker container:
docker run -p 3000:3000 -p 8888:8888 safe-crossing-backendor
docker run -p 3000:3000 -p 8888:8888 -d safe-crossing-backendto run the docker container in detached mode (runs in the background).
Simply type the following in your cmd:
# the run script builds and runs the docker container
sudo sh run.shor
# the run script builds and runs the docker container in detached mode
sudo sh run.sh -dto run the docker container in detached mode (runs in the background).
Install dependencies using npm:
npm installYou can then start your backend.
npm startAnd access using your browser.
http://localhost:3000/api/
To read more about: