Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/highb/rocket-pastebin
https://github.com/highb/rocket-pastebin
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/highb/rocket-pastebin
- Owner: highb
- Created: 2023-12-13T05:21:34.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-15T08:34:03.000Z (11 months ago)
- Last Synced: 2024-10-13T15:08:27.421Z (about 1 month ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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/.