cjdenio / shorty Goto Github PK
View Code? Open in Web Editor NEWHigh-performance link shortener
Home Page: https://clb.li
High-performance link shortener
Home Page: https://clb.li
To improve redirection speed, caching to a Redis datastore should be an option.
If I create a link, and then send a PATCH
with { "name": "" }
, shorty will happily change the name to be empty, thus preventing it from ever being referenced again (including being destroyed). See #11.
For comparison, PATCH
with { "name": null }
behaves as though the "name"
key weren't present. Though treating "name": ""
as though it weren't present at all may be a bit surprising.
I think the right behavior here is to treat PATCH
with { "name": "" }
as an error. Having that (or "name": null
) randomize the name might be surprising.
It would be awesome to be able to fetch all links stored in Redis.
Create an admin UI (I'll probably use Svelte or React)
This would be awesome to have!
track number of clicks, and maybe other (privacy-friendly) analytical info
I can create a link with an empty name by specifying { "name": "" }
as my input. this link doesn't appear to do anything (it doesn't affect the root redirection). But unfortunately I can't delete it, because I can't name it.
Expected behavior:
I expected the POST
with { "name": "" }
to either fail, or to behave as though "name" were not specified (i.e. generate a random name). I should not be able to create a link with no name.
My preferred behavior is "behave as though 'name' wasn't specified". That makes it a bit easier to script the API since I don't need to conditionally include the name
field.
Due to an issue with Rocket, URLs can't contain hash characters. This could be circumvented by manually setting the Location
header in the response.
If I issue a POST
to api/link
with "name": null
I get a 422 Unprocessable Entity response. It would be more convenient if passing null
behaved the same as omitting the key entirely. This would make it easier for me to script the API.
When creating links with the API, omitting the description
key entirely or passing { "description": null }
produces a link with "description": null
. However if I pass an empty string ({ "description": "" }
) I get back a link with "description": ""
. AFAIK this doesn't affect the behavior of the link redirector, but it is annoying from an API perspective as it means I have to check if the description is empty instead of just checking if it's non-null.
Expected behavior:
Passing { "description": "" }
should produce a link with { "description": null }
. Any links I retrieve with GET api/links
should ensure the description is either null or non-empty.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.