{"id":15065494,"url":"https://github.com/theantichris/url-shortener","last_synced_at":"2026-01-27T07:35:21.604Z","repository":{"id":57547486,"uuid":"295829931","full_name":"theantichris/url-shortener","owner":"theantichris","description":"A URL shortener written in Go.","archived":false,"fork":false,"pushed_at":"2020-10-22T11:36:31.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-02T16:41:47.026Z","etag":null,"topics":["go","golang","hexagonal-architecture","json","message-pack","mongodb","msgpack","redis"],"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/theantichris.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":"2020-09-15T19:31:31.000Z","updated_at":"2022-04-18T07:01:30.000Z","dependencies_parsed_at":"2022-09-26T22:24:00.004Z","dependency_job_id":null,"html_url":"https://github.com/theantichris/url-shortener","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theantichris/url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theantichris%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theantichris%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theantichris%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theantichris%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theantichris","download_url":"https://codeload.github.com/theantichris/url-shortener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theantichris%2Furl-shortener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28808097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:14:39.408Z","status":"ssl_error","status_checked_at":"2026-01-27T07:14:39.098Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","hexagonal-architecture","json","message-pack","mongodb","msgpack","redis"],"created_at":"2024-09-25T00:39:17.324Z","updated_at":"2026-01-27T07:35:21.587Z","avatar_url":"https://github.com/theantichris.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# url-shortener\n\n![Go](https://github.com/theantichris/url-shortener/workflows/Go/badge.svg) [![PkgGoDev](https://pkg.go.dev/badge/github.com/theantichris/url-shortener)](https://pkg.go.dev/github.com/theantichris/url-shortener)\n\nA URL shortener written in Go.\n\n## Available Ports \u0026 Adaptors\n\n### Repositories\n\n* MongoDB\n* Redis\n\n### Serializers\n\n* JSON\n* MessagePack\n\n## Development\n\n1. Start Mongo and Redis servers\n    * `docker-compose up`\n    * For Mongo add the `redirects` collection\n    * Mongo Express is accessible at `http://localhost:8081`\n1. Copy `sample.env` to `.env` and update values\n    * Set `DB_TYPE` to `mongo` or `redis`\n1. Start the application\n    * `go run main.go`\n    * The application is accessible at `http://localhost:8080`\n\n## Endpoints\n\n### GET /\n\nA health check endpoint that displays a message if the server is running.\n\n### POST /\n\nCreates a new redirect and returns the code.\n\n#### Body\n\n```json\n{\n    \"url\": \"http:/example.com\"\n}\n```\n\n#### Response\n\n```json\n{\n  \"code\": \"Rz5x645Mg\",\n  \"url\": \"https://example.com\",\n  \"created_at\": 1602164689\n}\n```\n\n### GET /{code}\n\nRedirects you to the URL for the specified code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheantichris%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheantichris%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheantichris%2Furl-shortener/lists"}