Link to hosted site here.
This project is a API for a game reviews. It is built with Node.js and Express, using a PostgreSQL database to store and retrieve data. The API allows users to create, read, update and delete data for various endpoints, including users, reviews, comments and categories.
- Install Node.js and PostgreSQL on your machine, if they are not already installed.
- Clone the repository to your local machine using the following command:
git clone [URL]
- Install dependencies by running the following command in the project's root folder:
npm install
- Create the necessary databases by running the following command:
npm run setup-dbs
- Seed the development database with data by running the following command:
npm run seed
-
Create two .env files in the project's root folder: .env.test and .env.development.
-
Add PGDATABASE=<database_name_here> to each .env file, as follows:
- .env.test: PGDATABASE=nc_games_test
- .env.development: PGDATABASE=nc_games
Note: Ensure that both .env files are .gitignored.
- Start the server by running the following command:
npm start
To run tests for this project, follow these steps:
-
Ensure that you have followed the setup instructions above, including creating the .env.test file.
-
Run the following command to execute the tests:
npm test
The following minimum versions are required to run the project successfully.
- Node.js >=6.9.0