{"id":15497412,"url":"https://github.com/heapwolf/redirector","last_synced_at":"2025-04-22T21:44:22.771Z","repository":{"id":20720650,"uuid":"24004728","full_name":"heapwolf/redirector","owner":"heapwolf","description":"A simple redirect server / URL shortener in C++ backed by nodeuv-http (libuv and http_parser) and leveldb.","archived":false,"fork":false,"pushed_at":"2014-09-18T14:04:01.000Z","size":147,"stargazers_count":12,"open_issues_count":3,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T19:11:09.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heapwolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-13T20:18:38.000Z","updated_at":"2024-06-28T21:37:55.000Z","dependencies_parsed_at":"2022-09-10T23:01:32.475Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/redirector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fredirector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fredirector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fredirector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fredirector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/redirector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250330433,"owners_count":21412980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:33:32.976Z","updated_at":"2025-04-22T21:44:22.751Z","avatar_url":"https://github.com/heapwolf.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\nA simple redirect server / URL shortener.\n\n# MOTIVATION\nAn example of how to use [`nodeuv-http`](https://github.com/hij1nx/nodeuv-http).\n\n# USAGE\n```bash\n./server\n```\n\n# HTTP API\n\n## SHORTEN\nTo shorten a urlencoded long url, add a `url` parameter to the query \nstring with its value encoded.\n\n### REQUEST\n```\nPUT http://mic.cm/shorten?url=http%3A%2F%2Fmic.com%2Fmy-long-url\n```\n\n### RESPONSE\n```\nHTTP/1.1 200 OK\nContent-Type: plain/text\n\naZ9yB\n```\n\n## REDIRECT\nTo redirect to long url, look up the url by the provided id and respond \nwith a `301` to the client with the long version of the url.\n\n### REQUEST\n```\nGET http://mic.cm/aZ9yB\n```\n\n### RESPONSE\n```\nHTTP/1.1 301 Moved Permanently\nLocation: http://mic.com/my-long-url\n```\n\n## SHORTEN EXISTING\nWhen the `/shorten` api call is made on an existing url, the url is looked\nup and if it's already shortened, the existing id is returned.\n\n### REQUEST\n```\nPUT http://mic.cm/shorten?url=http%3A%2F%2Fmic.com%2Fmy-long-url\n```\n\n### RESPONSE\n```\nHTTP/1.1 200 OK\nContent-Type: plain/text\n\naZ9yB\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fredirector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Fredirector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fredirector/lists"}