Giter Site home page Giter Site logo

be-nc-news's Introduction

Northcoders News Backend

Northcoders News is an interactive full stack news website. This API was made with Node.js, Express.js and MongoDB serving the database.

In order to download and run this project, it is necessary to have installed Node.js, npm and MongoDB on your computer.

To check if you have Node type on your terminal:

node -v

You can download Node here

When you download Node, you should also get npm with it.

To check if you have Mongo

mongo -v

Download MongoDB here

To download and use this project:

  • Open your terminal and navigate to the folder where you want to copy this project
git clone https://github.com/jenniredfield/BE-NC-News-Feb.git

Navigate to folder:

cd BE-NC-News-Feb

Install dependencies:

npm install

Run MongoDB on your terminal to start serving the database, type:

mongod

On another terminal tab and on the projects folder level, please seed the database with the command:

node seed/seed

To run tests Run mongo on your terminal

mongod

Making sure you are on the project folder, on your terminal type:

npm  test

To run server locally:

npm run dev

The server should be accesible on http://localhost:3001

API Routes

GET /api/topics

Get all the topics

GET /api/topics/:topic_id/articles

Return all the articles for a certain topic

GET /api/articles

Returns all the articles

GET /api/articles/:article_id

Returns a JSON object with the article information for the specified article

GET /api/articles/:article_id/comments

Get all the comments for an individual article

POST /api/articles/:article_id/comments

Add a new comment to an article. This route requires a JSON body with a comment key and value pair e.g: {"comment": "This is my new comment"}

PUT /api/articles/:article_id

Increment or Decrement the votes of an article by one. This route requires a vote query of 'up' or 'down' e.g: /api/articles/:article_id?vote=up

PUT /api/comments/:comment_id

Increment or Decrement the votes of a comment by one. This route requires a vote query of 'up' or 'down' e.g: /api/comments/:comment_id?vote=down

DELETE /api/comments/:comment_id

Deletes a comment

GET /api/users

Returns all users

GET /api/users/:username

Returns a JSON object with the profile data for the specified user.

be-nc-news's People

Contributors

jenniredfield avatar

Forkers

fbciriaco

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.