Skip to content

mundocalrisian/be-nc-news

Repository files navigation

Northcoders News API

Welcome to NC News!

NC News is an API written in JavaScript that uses PostgreSQL databases to interact with articles, comments, topics and users from various endpoints.

A hosted version of this API can be found at -

https://nc-news-b3bj.onrender.com/api

Additionally, a web application utilising this API can be seen here -

https://mundo-news.netlify.app/

Please note - on connecting for the first time, you may notice a bit of a delay in the articles and topics loading. This is normal whilst the instance spins up having not been used for a while and is a limitation of the free tier from Render.

Install

To start using this project, please first clone the repository from GitHub using the following command

git clone https://github.com/mundocalrisian/be-nc-news.git

Next you'll need to install the dependencies using

npm install

In order to seed the databases, you will need to create two files.env.test and .env.development and then input the following values PGDATABASE=nc_news_test and PGDATABASE=nc_news respectively (both of these values are also listed in the /db/setup.sql file).

Both these .env files should then be added to the .gitignore file.

Now to seed the databases, run the following

npm run setup-dbs

and to then seed each database

npm run seed

npm run test

API endpoints

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

  • serves an array of all users

GET /api/users/:username

  • serves an object of the user with requested username

GET /api/articles

  • serves an array of all articles

GET /api/articles/:article_id

  • serves an object of the article with requested id

GET /api/articles/:article_id/comments

  • serves an array of all comments assosciated with a requested id

POST /api/articles/:article_id/comments

  • posts a new comment and serves an object of the comment

PATCH /api/articles/:article_id

  • increases the votes assosciated with the requsted id and serves an object of the updated article

DELETE /api/articles/:article_id/

  • deletes the article with requested id

DELETE /api/comments/:comment_id/

  • deletes the comment with requested id

Technologies Used

Authors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 23