This project creates an API using Node.js and Postgres, which mimics the building of a real world backend service such as Reddit.
Users can view articles and interact with posted articles by commenting on or upvoting.
-
Clone this repository by running the following command:
git clone https://github.com/nkytruong/NC-news-api
-
Navigate to the cloned repository and run the following command to install all the dependencies needed:
npm install
-
To successfully connect to the databases locally, you must add both a .env.test file containing 'PGDATABASE=[YOURTESTDATABASE]' and a .env.development file containing 'PGDATABASE=[YOURACTUALDATABASE]'.
-
Seed your local database by running the following commands:
npm run setup-dbs npm run seed
-
Test your data by running the following command:
npm test index.test.js
- Node.js v21.7.2
- Postgres v14.11.0
Here is a link to the hosted API, deployed with Render, which will also provide you with a selection of endpoints that you can have a play around with:
https://nc-news-api-j07x.onrender.com/api
This portfolio project was created as part of a Digital Skills Bootcamp in Software Engineering provided by Northcoders