tpaschalis / al-dente-pasta

Minimalistic web app to provide pastebin-like functionality, built using a Python toolset.
MIT License
1 stars 0 forks source link

Outline API v1 and routing #3

Open tpaschalis opened 5 years ago

tpaschalis commented 5 years ago

Outline a v1 of the API. What routes should be available? How will pastes be identified? How will we handle a 404 page? Do we want more than just an index, a /status and an /about page?

tpaschalis commented 5 years ago
#
# Proposed MVP design for API/Routing
# Everything before / is the root domain
#

# Frontend

# Fetch an item
# Do we need the /view or not?
/view/<uid>/
/view/<uid>/raw

# Create a new paste
/new

# Generic error message redirection whenever something goes wrong.
/oops

# Do we have any other requirements for the frontend user?

# Backend/Curl
# api_key will be handed by ourselves, user must be able to generate new ones, we must be able to discard and authenticate users, by using crypto to match another auth token in the backend.
# 
# expiry can be 'h', 'd', 'w', 'm' ,'y'
# (or should we define expiry as number of hours?)
# if api_key is valid, expiry can also become 'never'
# lang can be one of the available markups we'll define.

# Create
/v1/new/
    ?api_key=<token>
    &expiry=<expiry_mode>
    &lang=<langage>

# Delete
/v1/delete/
    ?api_key=<token>
    &uid=<uid>

# Fetch all
/v1/list/
    ?api_key=<token>