This project uses Node.js
and PostgreSQL
to build a backend database and associated API. The app receives requests from the client at various endpoints, and responds with the required data from the news database.
Link to hosted version: https://nc-news-1d1v.onrender.com
NOTE: The minimum versions of Node.js and Postgres needed to run the project:
Node.js:
v21.1.0Postgres (PostgreSQL):
14.9
- Getting started
- Installing the dependencies
- Connecting to the required databases locally
- Seeding the local databases
- Running the tests
Clone the repository:
$ git clone https://github.com/emlips/nc-news.git
Navigate to the repository:
$ cd nc-news
Use the npm install
command to install the dependencies in the package.json
file:
$ npm install
Create a file .env.test
PGDATABASE=nc_news_test
Create a file .env.development
PGDATABASE=nc_news
Run the following scripts to setup and seed the databases locally:
- To create the databases:
$ npm run setup-dbs
- To seed the databases:
$ npm run seed
Run all test suites using the following script:
$ npm run test