Skip to content

kgodsmark/northcoders_news_sprint

Repository files navigation

Northcoders News Back-End

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.

Getting Started

To run this back-end on your local machine for development and testing purposes follow these guidelines.

Prerequisites

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

Instructions

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.

Launch API

Execute

$ npm install

And when finished

$ npm start

The following routes will be available in your localhost:3001

Routes

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

Running the tests

Run the tests in the mocha test environment

$ npm test

Built With

Authors

Acknowledgments

  • Northcoders coding bootcamp
  • Reddit

About

Full-stack project to present reddit-style northcoders news: BACK END

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published