API for the reddit-style northcoders news, using Node.js, express and a MongoDB. The API is hosted on heroku here.
The website using this API is hosted on heroku here.
To run this back-end on your local machine for development and testing purposes follow these guidelines.
Built on Node.js v8.6.0 and MongoDB v3.4.10. You will need Node.js and MongoDB installed locally.
Open your terminal window to check versions
$ node --version
$ mongod --version
Via your terminal window, clone this code onto your machine, go to the folder and install dependencies
$ npm install
Make sure a local MongoDB instance is running on port 27017
$ mongod
Seed the database
$ node seed/seed.js
The process can take up to a couple of minutes to complete as there is a lot of data. Once the process is complete you will see the log line 'Database Seeded' and the node process will exit.
Execute
$ npm install
And when finished
$ npm start
The following routes will be available in your localhost:3001
GET /api/topics
GET /api/topics/:topic_id/articles
GET /api/articles
GET /api/articles/:article_id/
GET /api/articles/:article_id/comments
POST /api/articles/:article_id/comments
PATCH /api/articles/:article_id
PUT /api/comments/:comment_id
DELETE /api/comments/:comment_id
GET /api/users/:username
GET /api/users/:username/repos
Run the tests in the mocha test environment
$ npm test
- Kerry Godsmark - Kerry
- Northcoders coding bootcamp