GithubHelp home page GithubHelp logo

s-hale / ncnewsbe Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6.8 MB

The back end section of a news website where users can browse by topic, post and delete comments and vote on content.

JavaScript 100.00%

ncnewsbe's Introduction

Northcoders News - BE

The back end section of a news website where users can browse a series of articles and narrow the selection down by topic. Users can add comments to articles, and delete their own, plus they have the ability to vote up or down on articles or comments.

A full version is hosted here: Northcoders News

Prerequisites

You will need Node.js, git and MongoDB.

Installing

Clone the repository then use npm i to install the dependencies. Start MongoDB and set up a local config file. Seed a local database with npm run seed. npm start will start the application. npm test will run the test file.

Running the tests

Mocha, Chai and supertest will be required to run the spec file.

Routes

The following routes are available on the API:

GET /api/articles

Returns all the articles in the database. Certain routes will redirect here.

GET /api/topics

Get all the topics. This route is used by a component, but the user is redirected back to /api/articles.

GET /api/topics/:topic_id/articles

Return all the articles for a chosen topic

GET /api/:article_id

Get an individual article

GET /api/articles/:article_id/comments

Get all the comments for a individual article. This route is used by a component; users will see the comments under the article as standard.

POST /api/articles/:article_id/comments

Adds a new comment to an article.

PUT /api/articles/:article_id

Using a query of 'up' or 'down', this route will increase or decrease the votes of an article by one.

PUT /api/comments/:comment_id

Using a query of 'up' or 'down', this route will increase or decrease the votes of a comment by one.

DELETE /api/comments/:comment_id

A user can delete their own comments. This feature is not available on other users' comments.

GET /api/users/:username

Returns the profile data for the specified user.

ncnewsbe's People

Contributors

s-hale avatar

Watchers

 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.