GithubHelp home page GithubHelp logo

be-project's Introduction

NC News API documentation

This is version of a social news aggregator website such as Reddit. It has been created with Node.js and Express. The data is stored with PostgreSQL and the API is hosted via ElephantSQL and Cyclic:

https://encouraging-dog-pleat.cyclic.app/api

All available endpoints

Installation

Installation Requirements:

Node.js: v17.9.0 or later PostgreSQL: v 10.21 or later

  1. Clone the repository in a new folder and cd into the directory

  2. Run npm install to install the project and any dependencies

  3. Create two .env files locally to setup environment variables for the test and development databases. These are already set to be ignored in .gitignore:

    echo 'PGDATABASE=nc_news' > ./.env.development
    echo 'PGDATABASE=nc_news' > ./.env.test
    
  4. run npm run setup-dbs to seed the development and test databases

  5. To run the app use: npm start

Testing

Testing in this application is done via the jest framework and can be run with the command: npm test

Available endpoints

These can also be viewed at the url: https://trickmirror.herokuapp.com/api

Method Endpoint Description
GET /api serves up a json representation of all the available endpoints of the api
GET /api/topics serves an array of all topics
GET /api/articles serves an array of all articles
GET /api/articles/:article_id serves an individual article from input id
GET /api/articles/:article_id/comments serves an array of comment objects from given ID
GET /api/users serves an array of all user objects
PATCH /api/articles/:article_id increments or decrements article vote by specified amount then returns object with new vote count
POST /api/articles/:article_id/comments posts a comment and username to the given article id and then returns an object with the posted comment and user
DELETE /api/comments/:comment_id deletes a comment from given comment id and returns a 204 status code

be-project's People

Contributors

anthonymedina avatar nc-paul-rogerson avatar pink-flag avatar daviidbartlett avatar p-copley avatar dav3rid avatar anatdean avatar sssam-c avatar alexander-cox avatar tomosim avatar isabelmaccabee avatar bainesface avatar douglashellowell avatar dentednerd avatar liam310 avatar rogersop avatar antariess avatar nicola-20 avatar two-triangles 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.