{"id":13413527,"url":"https://github.com/pantrif/url-shortener","last_synced_at":"2025-03-14T19:32:28.288Z","repository":{"id":57496886,"uuid":"135977273","full_name":"pantrif/url-shortener","owner":"pantrif","description":"A golang URL Shortener","archived":false,"fork":false,"pushed_at":"2023-02-06T10:28:56.000Z","size":25,"stargazers_count":48,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-31T20:52:32.606Z","etag":null,"topics":["bijective","golang","url-shortener"],"latest_commit_sha":null,"homepage":null,"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/pantrif.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":"2018-06-04T05:57:45.000Z","updated_at":"2024-07-17T01:16:25.000Z","dependencies_parsed_at":"2023-02-19T06:25:17.711Z","dependency_job_id":null,"html_url":"https://github.com/pantrif/url-shortener","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/pantrif%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantrif%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantrif%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pantrif%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pantrif","download_url":"https://codeload.github.com/pantrif/url-shortener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635486,"owners_count":20322948,"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":["bijective","golang","url-shortener"],"created_at":"2024-07-30T20:01:42.431Z","updated_at":"2025-03-14T19:32:27.962Z","avatar_url":"https://github.com/pantrif.png","language":"Go","funding_links":[],"categories":["Miscellaneous","杂项","Microsoft Office","其他杂项","Uncategorized","其他"],"sub_categories":["Uncategorized","Strings","Advanced Console UIs","未分类的","暂未分类","暂未分类这些库被放在这里是因为其他类别似乎都不适合。","交流"],"readme":"[![Build Status](https://travis-ci.com/pantrif/url-shortener.svg?branch=master)](https://travis-ci.com/pantrif/url-shortener)\n[![Go Report Card](https://goreportcard.com/badge/github.com/pantrif/url-shortener)](https://goreportcard.com/report/github.com/pantrif/url-shortener)\n[![GoDoc](https://godoc.org/github.com/pantrif/url-shortener?status.png)](http://godoc.org/github.com/pantrif/url-shortener)\n\n# url-shortener\nA golang URL Shortener with mysql support.  \nUsing Bijective conversion between natural numbers (IDs) and short strings\n\n# Installation\n## Using docker compose\n```\ndocker-compose up --build\n```\n## Using an existing mysql\n\nEdit .env file to add connection strings for mysql  \nRun mysql_init/create_table.sql  \n```\ngo run main.go\n```\n\n# Usage\n\n## Create short url\n```\ncurl -X POST -H \"Content-Type:application/json\" -d \"{\\\"url\\\": \\\"http://www.google.com\\\"}\" http://localhost:8081/shorten\n```\nExpected output  \n```\n{\"url\":\"localhost:8081/3\"}\n```\n\n## Redirect\n```\ncurl -v localhost:8081/3\n```\nOutput  \n```\n*   Trying ::1...\n* TCP_NODELAY set\n* Connected to localhost (::1) port 8081 (#0)\n\u003e GET /3 HTTP/1.1\n\u003e Host: localhost:8081\n\u003e User-Agent: curl/7.54.0\n\u003e Accept: */*\n\u003e\n\u003c HTTP/1.1 303 See Other\n\u003c Location: http://www.google.com\n\u003c Date: Mon, 04 Jun 2018 08:03:13 GMT\n\u003c Content-Length: 48\n\u003c Content-Type: text/html; charset=utf-8\n\u003c\n\u003ca href=\"http://www.google.com\"\u003eSee Other\u003c/a\u003e.\n```\n\n# Licence \nThis module is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantrif%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpantrif%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantrif%2Furl-shortener/lists"}