https://nc-news-4-life.onrender.com/api the "/api" will show you a list of endpoints and queries that you can use.
This project is an API for News Articles including users, comments, topics and of course, articles. It was developed using TDD and makes use of Express and the HTTP protocol. It makes use of GET, POST, PATCH and DELETE HTTP methods for relevant endpoints. Follow the link above to get started with your options.
Creating environment files
Use the following instructions to add the .env files which will allow you to create and access the databases.
- Create ".env.test" file to connect to the test database.
- Type in PGDATABASE=nc_news_test
- Create ".env.development" file to connect to the development database.
- Type in PGDATABASE=nc_news
Clone the Repo
Copy the following link, (Or copy the link from the GitHub Repo page) and use "git clone [link]" in the the terminal
https://github.com/LukeHarrisonDev/nc-news.git
Install the dependancies with "npm install"
Run 'npm install' to install the dependancies
Seed Databases
- Run the script "npm run setup-dbs" to create the databases
- Run the script "npm run seed" to seed the development database
- Run the app.test.js file using jest to seed the test database and simultaneously run the tests.
Running Tests
Tests include:
- app.test.js - Main test file that runs end 2 end tests
- model-utils.test.js - Tests any extra functions that are used by the model
- utils.test.js - Tests are for functions used during seeding
node.js v21.7.3 PostgreSQL 14.12
This portfolio project was created as part of a Digital Skills Bootcamp in Software Engineering provided by Northcoders