{"id":28164783,"url":"https://github.com/andreabac3/shortener-url-golang","last_synced_at":"2026-04-27T20:31:25.888Z","repository":{"id":40256905,"uuid":"200393443","full_name":"andreabac3/Shortener-URL-GOLANG","owner":"andreabac3","description":"Shortener URL in pure Golang and MongoDB","archived":false,"fork":false,"pushed_at":"2022-05-17T21:07:26.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T12:09:57.317Z","etag":null,"topics":["andreabac3","goland","golang","gorillamux","md5","mongo","mongodb","mongodb-driver","mux","shorten-urls","shortnerurl","shorturl","url","webserver"],"latest_commit_sha":null,"homepage":"","language":"Go","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/andreabac3.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":"2019-08-03T15:50:26.000Z","updated_at":"2024-05-17T03:52:31.000Z","dependencies_parsed_at":"2022-08-23T16:40:45.300Z","dependency_job_id":null,"html_url":"https://github.com/andreabac3/Shortener-URL-GOLANG","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andreabac3/Shortener-URL-GOLANG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreabac3%2FShortener-URL-GOLANG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreabac3%2FShortener-URL-GOLANG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreabac3%2FShortener-URL-GOLANG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreabac3%2FShortener-URL-GOLANG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreabac3","download_url":"https://codeload.github.com/andreabac3/Shortener-URL-GOLANG/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreabac3%2FShortener-URL-GOLANG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32354564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["andreabac3","goland","golang","gorillamux","md5","mongo","mongodb","mongodb-driver","mux","shorten-urls","shortnerurl","shorturl","url","webserver"],"created_at":"2025-05-15T12:09:56.464Z","updated_at":"2026-04-27T20:31:25.871Z","avatar_url":"https://github.com/andreabac3.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shortener URL in pure Golang and MongoDB\n\nThis code allows you to create a web server with the URL shortener function. \u003cbr\u003e\nIt's developed purely in Go, uses the official MongoDB drivers and Gorilla Mux for the routing.\n\n## Getting Started\n\n## Prerequisites\n```\nGolang\nMongoDB\nSetting up your .env file (path: src/.env)\n```\n### MongoDB\nDatabase Name = \"shorturl\" \u003cbr\u003e\nCollection Name = \"shorturldata\"\n```\n{ Url: 'string', Hash: 'hashed string' }\nAn example\n{ Url: 'www.andreabacciu.com', Hash: 'bd443137fc0662f1e10f7f71ac948766' }\n```\n\n## Test\n\nUse it in your favourite browser\n\n#### Record URL\nUse this link: http://127.0.0.1:8080/insert/www.yourWebSiteURL.com \u003cbr\u003e\n\u003cbr\u003e\nUsing this function you will register a new URL in the database. \u003cbr\u003e\nThe synopsis of this function requires a parameter in the URL of the HTTP request, this parameter \nis your URL to be shortened, this URL must not contain the prefix http:// or https:// or \nquotation marks.\n#### Redirect from shortner URL\nUse this link: http://127.0.0.1:8080/get/bd443137fc0662f1e10f7f71ac948766 \u003cbr\u003e\n\nUsing this function you will be redirected to the requested page.\u003cbr\u003e\n\u003cbr\u003e\nThe synopsis of this function requires a parameter in the URL of the HTTP request, this parameter is an already known hash of a link\n\n#### Convert from hashed URL to un-hashed URL \nUse this link: http://127.0.0.1:8080/get_no_redirect/bd443137fc0662f1e10f7f71ac948766 \u003cbr\u003e\n\u003cbr\u003e\nUsing this function you can go back to the name of the original link before the hash. \u003cbr\u003e\nThe synopsis of this function requires a parameter in the URL of the HTTP request, this parameter is an already known hash of a link\n\n## Program execution\n\nCompile it with GO\n\n# Known Issues\nThis is a toy project.\n* .env file needs a real path. (Path src/lib/mongodbConnection.go Function: Init() )\n* Currently, communications with the DB are not secure.\n* The recorded URL must not contain the prefix http:// or https:// or \nquotation marks.\n## Contributing\nFeel free to open issue or pull request.\n# Authors\n\n* **Andrea Bacciu**  - [github](https://github.com/andreabac3)\n\n## License\n[![](https://img.shields.io/npm/l/unique-names-generator.svg)](https://github.com/andreasonny83/unique-names-generator/blob/master/LICENSE) \u003cbr\u003e\nThis project is licensed under the MIT License - see the MIT license online for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreabac3%2Fshortener-url-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreabac3%2Fshortener-url-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreabac3%2Fshortener-url-golang/lists"}