Javascript files output is in dist folder
$ git clone https:/Demi-ob/alc_node.git
$ run docker-compose build
$ run docker-compose up
Note: for a docker environment a mongodb server is already setup in Dockerfile at mongodb:mongo:27010/alc
Also in .env file, MONGODB_URI = "mongodb://mongo:27017/alc"
localhost isnt used to prevent conflict
OR
docker image can also be downlaoded by running
$ docker pull demilade/alc_node
- clone repository
$ git clone https:/Demi-ob/alc_node.git
- Install dependencies -
npm install
- Compile -
gulp scripts
- Run the development server -
npm start
Note: for a system environment a mongodb server should be created at mongodb:localhost:27010/alc
Also in .env file MONGODB_URI should be changed, MONGODB_URI = "mongodb://localhost:27017/alc"
GET localhost:3000/api/v1/students
example: http.get(localhost:3000/api/v1/students)
@params {string} req.body.name
POST localhost:3000/api/v1/students
example: http.post(localhost:3000/api/v1/students, {name: "Demilade"})
(student_id is "_id" key in response object when a student is gotten from database)
@params {string} req.params.student_id
@params {string} req.body.name
POST localhost:3000/api/v1/students/:student_id
example: http.put(localhost:3000/api/v1/students/{_id}, {name: "Updated Demilade"})
@params {string} req.params.student_id
POST localhost:3000/api/v1/students/:student_id
example: http.put(localhost:3000/api/v1/students/{_id})