A simple URL-shortener.
All routes accept either form-encoded or JSON payloads, and return JSON.
Responses will always be an object with either a data or an error field.
Returns a route page.
Creates a new short URL.
url(string) required: The target URL.customPath(string) optional: The desired path to shorten to. Must be in[A-Za-z0-9-_]. If not provided, a random short code is generated instead.
A new shortened URL was created.
url(string): The URL provided.shortUrl(string): The shortened URL.
The request had missing or invalid params.
message(string): The error message.
The requested customPath is already in use.
message(string): The error message.
Redirects to the shortened URL.