{"id":23114411,"url":"https://github.com/justsharan/shorten","last_synced_at":"2025-04-04T00:43:46.398Z","repository":{"id":64303545,"uuid":"330719664","full_name":"justsharan/shorten","owner":"justsharan","description":"A basic URL shortener for personal use.","archived":false,"fork":false,"pushed_at":"2022-02-24T17:52:49.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T12:31:11.867Z","etag":null,"topics":["golang","links","sharex","shorten","url","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justsharan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-18T16:09:50.000Z","updated_at":"2022-02-21T02:35:24.000Z","dependencies_parsed_at":"2023-01-15T10:01:03.836Z","dependency_job_id":null,"html_url":"https://github.com/justsharan/shorten","commit_stats":null,"previous_names":["sinistrecyborg/shorten"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justsharan%2Fshorten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justsharan%2Fshorten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justsharan%2Fshorten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justsharan%2Fshorten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justsharan","download_url":"https://codeload.github.com/justsharan/shorten/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103305,"owners_count":20884023,"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":["golang","links","sharex","shorten","url","url-shortener"],"created_at":"2024-12-17T03:30:45.380Z","updated_at":"2025-04-04T00:43:46.378Z","avatar_url":"https://github.com/justsharan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shorten\n\nShorten is a tiny, speedy URL shortener written in pure Go, using just the standard library and no outside modules whatsoever. It stores the list of sites in a file called `routes.txt` and serves them.\n\n### Installation\n\nYou can get the appropriate executable for your system by visiting the [Releases](https://github.com/justsharan/shorten/releases) page.\n\n### API\n\n- `GET`\n  - `GET /`: Simple Hello World check to see if the program is online.\n  - `GET /:key`: Go to the URL with that key.\n- `POST`\n  - `POST /:key`: Create a new shortened URL with that key.\n- `DELETE /:key`: Delete the URL with that key.\n\n`POST` requests are treated as upserts. If you `POST` to a pre-existing URL, that key will simply be updated. This is simpler than having separate `POST` and `PUT` endpoints for adding and updating keys.\n\n### Usage\n\nWhen the program starts up, it'll give you an auth token to use for `POST` and `DELETE` endpoints. Be sure to save this in a safe place. A new one will be generated each time the program restarts. Here's an example using my own instance:\n\n```sh\n# Creating a new shortened URL\n$ curl -X POST cybg.cf/nyt \\\n       -H \"Authorization: AUTH_TOKEN_HERE\" \\\n       -d \"https://nytimes.com/section/todayspaper\"\n\n# Deleting a pre-existing URL\n$ curl -X DELETE cybg.cf/nyt \\\n       -H \"Authorization: AUTH_TOKEN_HERE\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustsharan%2Fshorten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustsharan%2Fshorten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustsharan%2Fshorten/lists"}