You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Create Database 'shopping' and 'shopping_test' in postgres
Create user
Create a new user in postgresEx: CREATE USER tom WITH PASSWORD 'myPassword';
Grant all priveleges
Grant the new user all privileges on both the databasesEx: GRANT ALL PRIVILEGES ON DATABASE shopping to tom;GRANT ALL PRIVILEGES ON DATABASE shopping_test to tom;
Create .env file
This file will hold the data used to connect to the database as well as some other important variables.Please create one that matches the following example and channge the values to your own:
[note] Please updatedatabase.json accordig to the values in this file
Migrate
run 'db-migrate up' to automatically create your database schema according to the one inREQUIREMENTS.md.
Scripts
run 'npm run watch' or 'yarn watch' to launch the servver to listen on the API endpoints.
run 'npm run test' or 'yarn test' to run all tests of the project, please look at the notes at the end of the document before running this command.
Project information
Ports
The backend runs on port 3000The database runs on port 5432
Endpoints
Can be found with detailed documentation in theREQUIREMENTS.md file.Below is a link to a postman collection that successfully calls each endpoint of the API[Note:] You might need to generate a different bearer token to the one saved in the collection if you changed the TOKEN_SECRET variable in the .env file