isra-fel / daole-backend

backend for daoleme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backend for Daoleme

API

/user

  • POST - signup
    • input: {username, password, email}
    • output:
      • success: 201 Created (with cookie)
      • fail: 409 Conflict, 400 Bad Request
  • PUT - update user setting *
    • input: {password} or {email}
    • output:
      • success: 200 OK
      • fail: 400 Bad Request

/user/signin

  • POST - signin
    • input: {username, password}
    • output:
      • success: 200 OK (with cookie)
      • fail: 401 Unauthorized

/user/signout

  • GET - signout *
    • output: 200 OK

/delivery

  • GET - list deliveries *
    • output: [{}]

/delivery/${delivery-id}

  • PUT - create delivery *
    • input: {company, alias, isPinned, isReceived}
    • output:
      • success: 201 Created
      • fail: 409 Conflict, 400 Bad Request
  • PUT - edit delivery *#
    • input: {isPinned} or {isReceived} or {alias} (you can edit only one field at a time)
    • output:
      • success: 200 OK
      • fail: 400 Bad Request, 404 Not Found
  • DELETE - remove favourite *#
    • output:
      • success: 200 OK
      • fail: 404 Not Found

Starred (*) APIs need authentication, the others do not. If these APIs are called without credentials (session), the server will return a 401 Unauthorized.

APIs with a # simbol support batch operations. Simply put a semicolon ; between the objects that you want to perform the batch operation on. E.g.

DELETE /delivery/${delivery-id-0};${delivery-id-1};...

About

backend for daoleme


Languages

Language:JavaScript 93.2%Language:HTML 6.8%