Project Hosting Link: NC News API
NC News API is a RESTful API that provides endpoints for news articles,topics and user interaction. The intention here is to mimic the building of a real world backend service (such as Reddit) which should provide this information to the front end architecture. With full Create, Read, Update and Delete (CRUD) functionality using the Model View Controller (MVC) software architecture and built using full Test Driven Development with Jest.
- Node.js
- Express.js
- Jest
- Supertest
- PostgreSQL
Follow these instructions to get a copy of the project up and running on your local machine.
Ensure you have the following installed:
- Node.js: v22.1.0 or later
- PostgreSQL: v16.3 or later
git clone https://github.com/OpaogunProsper/nc-news-backend.git
cd nc-news-backend
Install dependencies:
npm install
Create two .env
files in the root of your directory: .env.dev
and .env.test
.
PGDATABASE=database_name_here(followed with the appropriate suffix: dev/test)
Do that by running: npm setup-dbs
in your terminal
To seed the dev database, run the following command:
npm run seed
To run tests, use the following command:
npm test
If any issues are encountered, please open an issue on the repo.
For the endpoints available, please refer to the endpoints.json
file in the GitHub repository.