You can view the hosted API here: https://news-api-izsx.onrender.com/api/
In order to connect to your database you will need to set up the environment variables. Create two .env files for your project, one for your test database and one for your development database.
You can find the databse names in the sql files. Found at ./db/setup.sql.
In each file, add PGDATABASE=<database_name_here>
Ensure to gitignore these files if they contain sensitive information.
This API gives access to articles, comments, topics and users from the news database.
-
Clone the repository:
[email protected]:rorybush/news-api.git
-
Install the dependencies:
npm i
-
Create 2 ENV files. Add
PGDATABASE=<database_name>
to the.env.test
and.env.development
files. -
Seed the local database:
npm run setup-dbs
npm run seed
-
Use the following command to run the test:
npm t
Node.js 18.10.0
Postgres ^8.7.3