NC News is a RESTful API that powers a news site for articles, topics, comments, and users, built with Node.js, Express, and PostgreSQL. For the connected frontend, visit this repository: XQ News Frontend.
The hosted version of the API can be found here.
To set up this project locally, follow these steps:
Run the following command to install dependencies:
npm install
Create two files, **.env.development**
and **.env.test**
, in the root directory:
-
.env.development:
PGDATABASE=nc_news
-
.env.test:
PGDATABASE=nc_news_test
These files are required to configure the database connections.
To create and seed the local database, run:
npm run setup-dbs && npm run seed
To run the tests, use:
npm test
You can also run specific tests:
-
API Tests:
npm test app
-
Utility Tests:
npm test utils
-
Node.js: v21.6.2 or higher
-
PostgreSQL: v14.11 or higher
This API was built as part of a software engineering bootcamp with Northcoders.