{"id":16434762,"url":"https://github.com/zce/short","last_synced_at":"2025-02-25T21:16:07.991Z","repository":{"id":37033840,"uuid":"344123997","full_name":"zce/short","owner":"zce","description":"A short url service.","archived":false,"fork":false,"pushed_at":"2024-12-10T01:16:15.000Z","size":85,"stargazers_count":12,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-08T09:51:34.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://t.zce.me","language":"HTML","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/zce.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"zce"}},"created_at":"2021-03-03T12:47:45.000Z","updated_at":"2024-12-10T01:16:12.000Z","dependencies_parsed_at":"2023-01-20T12:06:42.296Z","dependency_job_id":"99a13ca1-2692-4509-bae9-e1a3d3faf558","html_url":"https://github.com/zce/short","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/zce%2Fshort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fshort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fshort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zce%2Fshort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zce","download_url":"https://codeload.github.com/zce/short/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240746959,"owners_count":19850996,"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-11T08:50:02.365Z","updated_at":"2025-02-25T21:16:07.882Z","avatar_url":"https://github.com/zce.png","language":"HTML","funding_links":["https://github.com/sponsors/zce"],"categories":[],"sub_categories":[],"readme":"# short\n\n\u003e A short url service.\n\n## Online Services\n\n- https://zvu.cc\n- https://t.zce.me\n\n## Getting Started\n\n```shell\n$ git clone https://github.com/zce/short.git\n$ cd short\n$ cp .env.example .env\n$ vi .env # add your upstash redis url \u0026 token\n$ npm install\n$ npm run develop\n```\n\n### Environment Variables\n\n- `UPSTASH_REDIS_REST_URL`: Upstash redis rest url.\n- `UPSTASH_REDIS_REST_TOKEN`: Upstash redis rest token.\n\n### Deploy\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fzce%2Fshort\u0026project-name=my-short\u0026repository-name=my-short\u0026integration-ids=oac_V3R1GIpkoJorr6fqyiwdhl17)\n\n## Endpoints\n\n### POST `/create`\n\nCreate a new short url.\n\n```shell\n$ curl https://t.zce.me/create -d \"url=https://zce.me\" -d \"slug=zce\"\n```\n\n#### Parameters\n\n- `url`: target url\n- `slug`: short slug, optional, default: `auto nanoid`\n\n#### Response Type\n\n```json\n{\n  \"slug\": \"\u003cslug\u003e\",\n  \"link\": \"http://t.zce.me/\u003cslug\u003e\"\n}\n```\n\n## REST API Test\n\n### Bad request\n\n```http\nPOST http://localhost:3000/create HTTP/1.1\n\n# {\n#   \"error\": \"Bad Request\",\n#   \"message\": \"Illegal body: unexpected end of JSON input.\"\n# }\n```\n\n### No parameters\n\n```http\nPOST http://localhost:3000/create HTTP/1.1\ncontent-type: application/json\n\n{}\n\n# {\n#   \"error\": \"Bad Request\",\n#   \"message\": \"Missing required parameter: url.\"\n# }\n```\n\n### Request with url parameter\n\n```http\nPOST http://localhost:3000/create HTTP/1.1\ncontent-type: application/json\n\n{\n  \"url\": \"https://www.google.com\"\n}\n\n# {\n#   \"slug\": \"bPVp\",\n#   \"link\": \"http://localhost:3000/bPVp\"\n# }\n```\n\n### Request with url \u0026 slug parameters\n\n```http\nPOST http://localhost:3000/create HTTP/1.1\ncontent-type: application/json\n\n{\n  \"url\": \"https://www.google.com\",\n  \"slug\": \"google\"\n}\n\n# {\n#   \"slug\": \"google\",\n#   \"link\": \"http://localhost:3000/google\"\n# }\n```\n\n### Request with url \u0026 exist slug parameters\n\n```http\nPOST http://localhost:3000/create HTTP/1.1\ncontent-type: application/json\n\n{\n  \"url\": \"https://www.google1.com\",\n  \"slug\": \"google\"\n}\n```\n\n# {\n#   \"error\": \"Bad Request\",\n#   \"message\": \"Slug already exists.\"\n# }\n```\n\n### Redirect to url\n\n```http\nGET http://localhost:3000/google HTTP/1.1\n```\n\n## License\n\n[MIT](LICENSE) \u0026copy; [zce](https://zce.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzce%2Fshort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzce%2Fshort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzce%2Fshort/lists"}