Code Monkey home page Code Monkey logo

shorty's Issues

Redis caching

To improve redirection speed, caching to a Redis datastore should be an option.

Admin UI

Create an admin UI (I'll probably use Svelte or React)

I can mix `"description": ""` and `"description": null` in my links

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.

Click tracking

track number of clicks, and maybe other (privacy-friendly) analytical info

Empty link can be created but not destroyed

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.

`PATCH` can still create links with empty name

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.