This service will distinguish database users from others and allow users to record messages. Users can also view 10 last messages.
/auth/loginsend here POST wis JSON{"user": "admin", "password": "password"}to login and get token. Answer be{"token": "SOM TOKEN"}./messagessend here POST wis HEADERAuthorization: Raerer_SOME TOKENand JSON{"name": "admin", "message": "som message"}to write this message or JSON{"name": "admin", "message": "history 10"}to get last 10 messages.
-
To login type
curl -X POST http://185.164.172.63:49001/auth/login -H 'Content-Type: application/json' -d '{"name":"admin","password":"password"}' -
Get token and put it here
curl -X POST http://185.164.172.63:49001/messages -H 'Authorization: Bearer_TOKEN' -H 'Content-Type: application/json' -d '{"name":"admin","message":"test"}' -
Put token her to see last 10 messages
curl -X POST http://185.164.172.63:49001/messages -H 'Authorization: Bearer_TOKEN' -H 'Content-Type: application/json' -d '{"name":"admin","message":"history 10"}'
- Clone this repository
git clone https://github.com/QmBo/message-server.git - Get in directory
cd ./message-server - Run
docker-compose up
- Create a database in Postgres
create database messageserver - Clone this repository
git clone https://github.com/QmBo/message-server.git - Get in directory
cd ./message-server - Run
mvnw spring-boot:run