Skip to content

pastr-git/server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pastr Server - ASPNet Core

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

Build Status

Branch Status
master CircleCI

Endpoints

{BASE} = Base API Url - https://pastr.userr00t.com/api

GET {BASE}/paste/{id}

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"
}

GET {BASE}/paste/{id}/raw

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.

POST {BASE}/paste/

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"
}

PUT {BASE}/paste/

Updates existing paste. editCode and ID must be provided. Other fields will be overwritten.

{BASE}/paste/dummy

Expected status code: 200

DELETE {BASE}/paste/

Deletes existing paste. editCode and ID must be provided. Paste will be fully deleted.

{BASE}/paste/dummy

Expected status code: 204


Todo

  • Unit tests