Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janl/io
Personal URL shortening with CouchDB
https://github.com/janl/io
Last synced: 24 days ago
JSON representation
Personal URL shortening with CouchDB
- Host: GitHub
- URL: https://github.com/janl/io
- Owner: janl
- License: mit
- Created: 2009-10-11T06:23:31.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2010-07-31T12:50:38.000Z (over 14 years ago)
- Last Synced: 2024-10-02T09:54:47.804Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 110 KB
- Stars: 90
- Watchers: 6
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - janl/io - Personal URL shortening with CouchDB (others)
README
The cool stuff happens in updates/shorten.js and shows/long.js
Create a short:
curl -X POST http://127.0.0.1:5984/io/_design/io/_update/shorten?target=http://zombo.com/
You should see:
Shortened to yvHa
Get the redirect:
http://127.0.0.1:5984/io/_design/io/_show/long/yvHa
For maximum effect, deploy behind an HTTP proxy that aliases / to
http://127.0.0.1:5984/io/_design/io/_show/long/--
Go to http://127.0.0.1:5984/io/_design/io/_list/index/shorts to see a list of
all shortened URLs.The list & view that power this make this > 30 LoC, but the updates/shorten.js
and shows/long.js are still tight.