rslim087/grade-submission-api
This is a Node.js API for managing grade submissions.
188
This is a Node.js API for managing grade submissions.
To run the Grade Submission API container, use the following Docker command:
docker run --name node-server --network my-network -p 3000:3000 rslim087/grade-submission-api:1.0.0
For version 2.0.0 with MongoDB integration, use the following commands:
docker run --name mongodb -d -p 27017:27017 mongo
docker run --name node-server --network my-network -p 3000:3000 -e DB_HOST=mongodb -e DB_PORT=27017 -e DB_NAME=gradesDB rslim087/grade-submission-api:2.0.0
These commands do the following:
node-server
.my-network
.mongodb
and sets environment variables for database connectivity.rslim087/grade-submission-api:1.0.0
or rslim087/grade-submission-api:2.0.0
image, depending on the version.Make sure you have created the Docker network my-network
before running the containers. For 2.0.0, ensure that the MongoDB container is running before starting the Grade Submission API container.
GET /grades
: Retrieves all grade submissions.POST /grades
: Creates a new grade submission.The Grade Submission API 2.0.0 integrates with a MongoDB database for persistent storage of grade submissions. The following environment variables are required for the database connection:
DB_HOST
: The hostname or IP address of the MongoDB container.DB_PORT
: The port number of the MongoDB container.DB_NAME
: The name of the database to store grade submissions.Make sure to provide the appropriate values for these environment variables when running the 2.0.0 container.
The Docker image is built using the following Dockerfile:
FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["node", "app.js"]
The image is based on the Node.js 14 base image and runs the app.js
file when the container starts.
Version 1.0.0:
Version 2.0.0:
This project is licensed under the MIT License.
docker pull rslim087/grade-submission-api