This is a offline messaging api that I made with javascript. I use javascript/nodejs as a runtime and JWT for authentication/Authorization.
You can run the server with
docker-compose up --build -d
and -npm install
-npm start
- method:
POST
- path:
/user/create
- body:
{ "username": string, "password": string }
- response:
{ "success": boolean, "message": string, }
- method:
POST
- path:
/user/getToken
- body:
{ "username": string, "password": string }
- response:
{ "status": boolean, "token": string, }
- 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 }
- 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 }
- 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 }
- 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 }