Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/highb/rocket-pastebin


https://github.com/highb/rocket-pastebin

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# rocket-pastebin

## Usage

`cargo run`

## What is this?

Created by following the [Rocket tutorial](https://rocket.rs/v0.5/guide/pastebin-tutorial/).

## What are some ways to go from here?

* Add a web form to the index where users can manually input new pastes. Accept the form at POST /. Use format and/or rank to specify which of the two POST / routes should be called.
* Support deletion of pastes by adding a new DELETE / route. Use PasteId to validate .
* Indicate partial uploads with a 206 partial status code. If the user uploads a paste that meets or exceeds the allowed limit, return a 206 partial status code. Otherwise, return a 201 created status code.
* Set the Content-Type of the return value in upload and retrieve to text/plain.
* Return a unique "key" after each upload and require that the key is present and matches when doing deletion. Use one of Rocket's core traits to do the key validation.
* Add a PUT / route that allows a user with the key for to replace the existing paste, if any.
* Add a new route, GET // that syntax highlights the paste with ID for language . If is not a known language, do no highlighting. Possibly validate with FromParam.
* Use the local module to write unit tests for your pastebin.
* Dispatch a thread before launching Rocket in main that periodically cleans up idling old pastes in upload/.