{"repo":"thewalkingtoast/mpngin","free":true,"listed":false,"github":"https://github.com/thewalkingtoast/mpngin","clone":"git clone https://github.com/thewalkingtoast/mpngin.git","description":"A simple and fast URL shortener with built in stats.","language":"Crystal","stars":36,"topics":["crystal","crystal-language","redis","url-shortener"],"license":"MIT","category":"databases-storage","readme_excerpt":"MPNG.IN A simple and fast URL shortener with built in stats. Requires Redis and assumes it is local for lowest possible latency. Installation Copy env.example to .env and set the values. For the SECRET TOKEN you can generate one with $ crystal eval \"puts Random::Secure.hex(32)\" . NOTE: If building in release mode for production, ensure KEMAL ENV is uncommented in .env and set to production . Then run: Production Use For production, make a release build with KEMAL ENV uncommented in .env and set to production : The .env must accompany the built binary at the same filesystem level. Example production tree: Usage Creating an short URL and getting the stats require an application key first. 1) Create an application first: 2) Use the app key in place of the SECRET TOKEN to make shortened URLs, passing in the final redirect to URL as a application/x-form-urlencoded body param named redirect url : 3) Get number of requests for this shortened URL: Dynamic Short Link Domain at Request Time You can change the top-level short link domain at request time via the short url parameter when creating a short link. For example, if normally you use mpng.in for the short URL but want to use thehorde.org instead on a per-request basis, you can easily do so: Note: Short codes are unique per short URL Link Inspect To get more detailed information, you can also inspect a link to get info such as the expanded link and request count with a report timestamp in which ever format you need: Link Report MP","default_branch":null,"files":null,"tree":[],"storefront":"/r/thewalkingtoast","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/thewalkingtoast/mpngin/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}