The project provides some endpoints to interact with the various topics, articles, users and comments about NC News. All available endpoints can be found in the endpoints.json file.
The hosted API can be accessed at the following URL: NC News Backend API
In the terminal, run the following commands
git clone https://github.com/umerxz/be-nc-news-backend-project.git
cd be-nc-new-backend-project
To install all relevant dependencies and devDependencies from package.json, run
npm install
This will install the following setted up dependencies
Dependencies | devDependencies |
---|---|
husky | jest |
dotenv | jest-extended |
express | jest-sorted |
pg | supertest |
pg-format |
To connect to the databases:
1. Install postgres and start the server.
2. In the root directiry, create 2 files, .env.test and .env.development, for test and development. Add these files in .gitignore.
3. In each file use PGDATABASE=database_name, replacing the database_name with the name of the database to connect to.
To create and seed the database run the following commands
npm run setup-dbs
npm run seed
To run all the test files and test cases, issue the command:
npm test
to run tests for a specific file, just add the test filename at the end of the above command.
Node.js 21.6.1 Postgres 14.10
This portfolio project was created as part of a Digital Skills Bootcamp in Software Engineering provided by Northcoders