Create a database with the command CREATE DATABASE scheduler_development;
.
Copy the .env.example
file to .env.development and fill in the necessary PostgreSQL configuration. The node-postgres
library uses these environment variables by default.
PGHOST=
PGUSER=
PGDATABASE=
PGPASSWORD=
PGPORT=
Two ways to seed the database.
- Can run
npm run test
from within this project. - Run a development server and issue a command
curl -X POST http://localhost:3001/api/debug/reset
.
GET /api/days
Response
[
{
"id": 1,
"name": "Monday",
"appointments": [1, 2],
"interviewers": [1, 2],
"spots": 0
}
]
GET /api/appointments
Response:
{
"1": {
"id": 1,
"time": "12pm",
"interview": {
"student": "Lydia Miller-Jones",
"interviewer": 1
}
},
"2": {
"id": 2,
"time": "1pm",
"interview": {
"student": "Archie Cohen",
"interviewer": 2
}
}
}
PUT /api/appointments/:id
Body:
{
"interview": {
"student": String,
"interviewer": Number
}
}
DELETE /api/appointments/:id
GET /api/interviewers
Response:
{
"1": {
"id": 1,
"name": "Sylvia Palmer",
"avatar": "https://i.imgur.com/LpaY82x.png"
},
"2": {
"id": 2,
"name": "Tori Malcolm",
"avatar": "https://i.imgur.com/Nmx0Qxo.png"
}
}