This is the backend code for the Pastr service. For frontend go to this repository.
Api info paste -> https://pastr.userr00t.com/api_info.md
Branch | Status |
---|---|
master |
{BASE} = Base API Url - https://pastr.userr00t.com/api
Fetches one paste by ID.
{BASE}/paste/dummy
Expected status code: 200
Expected Content Type: application/json; charset=utf-8
Expected output:
{
"id":"dummy",
"title":"Dummy Response",
"content":"This is a dummy response used for testing.",
"date":"2019-08-29T14:44:28.377Z"
}
Fetches the raw content of one paste by ID.
{BASE}/paste/dummy/raw
Expected status code: 200
Expected Content Type: text/plain; charset=utf-8
Expected output:
This is a dummy response used for testing.
Creates a new post.
{BASE}/paste
Expected status code: 200
Expected Content Type: application/json; charset=utf-8
Expected output:
{
"id":"dummy",
"title":"Dummy Response",
"content":"This is a dummy response used for testing.",
"date":"2019-08-29T14:44:28.377Z"
}
Updates existing paste. editCode and ID must be provided. Other fields will be overwritten.
{BASE}/paste/dummy
Expected status code: 200
Deletes existing paste. editCode and ID must be provided. Paste will be fully deleted.
{BASE}/paste/dummy
Expected status code: 204
- Unit tests