Giter Club home page Giter Club logo

northcoders-news-api's Introduction

Northcoders News API

Background

We will be building the API which we used in the Northcoders News Sprint during the Front End block of the course. Your mongoose models and a Database seed file have been done for you.

Tasks

  1. Seed your database with the main seed file $ node seed/seed.js
  2. Build your express App
  3. Mount an API Router onto your app
  4. Define the routes described below
  5. Define controller functions for each of your routes
  6. Test your api! (Day two)

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/comments

Get all the comments for a 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/:username

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

northcoders-news-api's People

Contributors

blackbeltapple avatar daveg437 avatar northcoders-chris avatar

Watchers

James Cloos avatar

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.