Skip to content

An app that allows the user to rent from those providing technology, such as cameras or TVs.

License

Notifications You must be signed in to change notification settings

ttwebft20-Use-My-Tech-Stuff/node-back-end

Repository files navigation

Node Back-End - Build Week - tt_wbft_20 - Jennifer Kramer

[Endpoints] Base URL: https://ttwebft20-use-my-tech-stuff.herokuapp.com/api

  • This url will be the beginning of all endpoints. Add the following endpoints below to the base URL.

[Register]

  • No token is required when registering

  • Example: https://ttwebft20-use-my-tech-stuff.herokuapp.com/api/auth/register

    • [POST] [Register] - Register a new user

      • Endpoint: /auth/register

      Fields:
      "username" - string, unique (MUST not match any other registered username), REQUIRED
      "first_name" - string, REQUIRED
      "last_name" - string, REQUIRED
      "email" - string, unique (MUST not match any other registered email), REQUIRED
      "zipcode" - string, REQUIRED
      "password" - string, REQUIRED
      "role" - string, MUST be "owner" or "renter", REQUIRED

      SERVER PUTS IN THE FIELDS BELOW AUTOMATICALLY "created_at" - timestamp, no need on client-end
      "updated_at" - timestamp, no need on client-end

[Login]

  • Token required for login

  • Example: https://ttwebft20-use-my-tech-stuff.herokuapp.com/api/auth/login

    • [POST] [Login] - Login an already registered user to receive a token

      • Endpoint: /auth/login

      Fields:
      "username" - string, MUST match a registered username, REQUIRED
      "password" - string, MUST match a registered password with registered username, REQUIRED

[Users]

[Tech Items - Find]

[Tech Items - Add]

  • Token required to add tech items

  • Example: https://ttwebft20-use-my-tech-stuff.herokuapp.com/api/tech_items

    • [POST] [AddNewTechItem] - Add a new tech item

      • Endpoint: /tech_items

      Fields:
      "img_url" - binary, up to 2000 characters
      "item_name" - string, up to 50 characters, REQUIRED
      "category" - string, REQUIRED
      "description" - text, up to 500 characters, REQUIRED
      "rented" - boolean, determines if available or rented, not required
      "price" - integer, REQUIRED
      "owner_username" - string, REQUIRED

      SERVER PUTS IN THE FIELDS BELOW AUTOMATICALLY "created_at" - timestamp, no need on client-end
      "updated_at" - timestamp, no need on client-end

[Tech Items - Update]

  • Token required to update tech item by ID

  • Example: https://ttwebft20-use-my-tech-stuff.herokuapp.com/api/tech_items/1

    • [PUT] [UpdateTechItem] - Edit a registered tech item

      • Endpoint: /tech_items/:id

      Fields:
      "img_url" - binary, up to 2000 characters
      "item_name" - string, up to 50 characters, REQUIRED
      "category" - string, REQUIRED
      "description" - text, up to 500 characters, REQUIRED
      "rented" - boolean, determines if available or rented, not required
      "price" - integer, REQUIRED
      "owner_username" - string, REQUIRED

      SERVER PUTS IN THE FIELDS BELOW AUTOMATICALLY "created_at" - timestamp, no need on client-end
      "updated_at" - timestamp, no need on client-end

[Tech Items - Delete]

About

An app that allows the user to rent from those providing technology, such as cameras or TVs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published