ptpb / pb

pb is a formerly-lightweight pastebin and url shortener
Other
549 stars 52 forks source link

better URL routing #108

Closed buhman closed 9 years ago

buhman commented 9 years ago

One of the issues in solving #107 is URL routing.

Currently we rely on regular expressions to figure out which kind of get we want, but this is actually no longer necessary.

Instead, this should be refactored into a single route/converter that accepts all paths, and finds any paste (or redirect, which would be refactored into a special type of paste) that matches in any field in any way.

As a result of merging redirects with pastes, we could go back to everything being 4-character IDs (as returned by the API), while allowing retrieval with any number of characters.