Method | Endpoint | Action | Front-end Request | Back-end Response |
---|---|---|---|---|
POST | 'api/auth/signup' | sign up new user | { username: String! password: String! } |
{ id: Int! username: String! token: String! tokenExpiration: Int!(mins) } |
POST | 'api/auth/login' | login user | { username: String! password: String! } |
{ id: Int! username: String! token: String! tokenExpiration: Int!(mins) } |
GET | '/restaurants' | get all taco restaurants | [Restaurant] | |
GET | '/restaurants/:id/reviews' | get all reviews from a restaurant with id | (id in url) | { ...Restaurant reviews: { ...Original Review adju_score: Int! } } |
Restaurant | Reviewer | Original Review | |
---|---|---|---|
Fields | id: String! name: String! true_score: Int! adju_score: Int! |
id: Int! username: String! |
id: String! reviewer: Reviewer! review: String! score: Int! date_created: Date! date_updated: Date! |