Skip to content

bw-wlj-2/Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weight Lifting Backend

Dependencies

  • node.js
  • express
  • knex
  • sqlite3
  • pg
  • jsonwebtoken
  • nodemon
  • dotenv
  • supertest
  • jest

User Table

field data type metadata
id unsigned integer primary key, auto-increments, generated by database
username string required, unique
password string required
location string required
avatarUrl string required

User Endpoints

  • GET /api/user/:id - takes an id and returns the account associated with it
  • POST /api/user/register - creates an account
  • POST /api/user/login - login
  • DELETE /api/user/:id - takes user id and removes it from the database
  • PUT /api/user/:id - takes user id and changes object and updates the id specified

Exercise Table

field data type metadata
id unsigned integer primary key, auto-increments, generated by database
name string required, unique
region string required

Exercise Endpoints

  • GET /api/exercises - gets a list of all the exercises
  • GET /api/exercises/users/:id - gets all exercises created by that user id
  • GET /api/exercises/:id - gets a single exercise
  • GET /api/exercises/regions/:region - gets all exercises for a certain region
  • POST /api/exercises - adds a new exercise
  • PUT /api/exercises/:id - can update an exercise
  • DELETE /api/exercises/:id - deletes a single exercise

Example

{ "name": "Pull Ups", "region": "arms" }

About

Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors