- Clone the repository with
git clone https://github.com/Stacks-Records/stacks-be.git
- cd into the repository
- Run
npm install
- Install knex globally by running
npm install knex -g
and then runnpm install knex --save
to useknex
CLI commands - Install pg module
npm install pg --save
to connect to PostgreSQL - In the root directory, navigate to
knexfile.js
and configure your environment connection - To migrate and seed data, run
knex migrate:latest && knex seed:run
- Navigate to
/api
folder from the root directory - Run
node index.js
to start the server
- Express.js, PostgreSQL, Knex.js, Auth0
- Endpoint:
/albums
- Method:
GET
- Description: Get all albums
- Endpoint:
/albums/:id
- Method:
GET
- Description: Get a single album using the album id
- Endpoint:
/add-stack
- Method:
POST
- Description: Add a new album to the album collection
- Endpoint:
/api/v1/users
- Method:
GET
- Description: Get all users in the database
- Endpoint:
/api/v1/users
- Method:
POST
- Description: Adds a user to the database if the user doesn't already exist
- Endpoint:
/api/v1/stacks
- Method:
PATCH
- Description: Adds a user's favorited album to the user's table
- Endpoint:
/api/v1/stacks/delete
- Method:
PATCH
- Description: Delete a user's favorited album from the user's table
- Endpoint:
/api/v1/stacks
- Method:
GET
- Description: Get the user's favorited albums