Skip to content

viLoqi/messaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

messaging

  • The current implementation requires the credentials.json file

Service to write/update/delete records stored inside Firebase Firestore.

Simulate API Requests with curl

POST /api/messaging

curl -X POST http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "collectionPath": "chats/SAM101/sec01/room/messages",
    "content": "This is written RIGHT NOW!",
    "author": "Jie Chen",
    "authorPhotoURL": "www."
}'

Response

{
    "messageID": uuid
}

GET /api/messaging

curl -X GET http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "fullMessagePath": "chats/SAM101/sec01/room/messages/{messageID}"
}'

Response

{
    "author": string,
    "content": string,
    "firstCreated": Date,
    "lastUpdated": Date
}

PATCH /api/messaging

curl -X PATCH http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "fullMessagePath": "chats/SAM101/sec01/room/messages/{messageID}",
    "content": "This is a revised version"
}

Response

{
    "UpdateTime": Date
}

DELETE /api/messaging

curl -X DELETE http://localhost:8080/api/messaging -H 'Content-Type: application/json' -d \
'{
    "fullMessagePath": "chats/SAM101/sec01/room/messages/{messageID}"
}'

Response

{
    "removedFullMessagePath": string
}

About

Write/Update records in Firestore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published