Skip to content

mustafakamay/offline-messaging-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Offline-Messaging-Api

This is a offline messaging api that I made with javascript. I use javascript/nodejs as a runtime and JWT for authentication/Authorization.

Build and run

You can run the server with docker-compose up --build -d and -npm install -npm start

Endpoints

SignUp

  • method: POST
  • path: /user/create
  • body:
    {
        "username": string,
        "password": string
    }
  • response:
    {
    "success": boolean,
    "message": string,
    }

Login

  • method: POST
  • path: /user/getToken
  • body:
    {
        "username": string,
        "password": string
    }
  • response:
    {
    "status": boolean,
    "token": string,
    }

Block User

  • method: POST
  • path: /user/blockUser
  • Header:

    Name Description Type
    Authorization authentication token of the user String
  • body:
    {
        "blockedUser": string,
    }
  • response:
    {
    "id": integer,
    "blockerUser": string,
    "blockedUser": string,
    "createdAt": string
    }

Send Message

  • method: POST
  • path: /message/create
  • Header:

    Name Description Type
    Authorization authentication token of the user String
  • body:
    {
        "to": string,
        "content": string
    }
  • response:
    {
    "id": integer,
    "from": string,
    "to": string,
    "content": string,
    "createdAt": string
    }

Get Message History

  • method: GET
  • path: /message/allMessages
  • Header:

    Name Description Type
    Authorization authentication token of the user String
  • response:
    {
    "id": integer,
    "from": string,
    "to": string,
    "content":string,
    "createdAt": string
    }

Get Message History By User

  • method: GET
  • path: /message/allMessagesBySender/:sender
  • Header:

    Name Description Type
    Authorization authentication token of the user String
  • response:
    {
    "id": integer,
    "from": string,
    "to": string,
    "content":string,
    "createdAt": string
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published