{"id":19729437,"url":"https://github.com/benjammin4dayz/shortlink","last_synced_at":"2026-01-21T20:39:48.272Z","repository":{"id":252330374,"uuid":"840054134","full_name":"benjammin4dayz/shortlink","owner":"benjammin4dayz","description":"Self-hostable link shortener","archived":false,"fork":false,"pushed_at":"2024-08-09T12:10:37.000Z","size":76,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T08:45:54.690Z","etag":null,"topics":["api","docker","documented","link-shortener","mvc","self-hosted","shortener-service","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/benjammin4dayz.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}},"created_at":"2024-08-08T21:59:28.000Z","updated_at":"2024-08-09T19:26:45.000Z","dependencies_parsed_at":"2024-11-12T01:45:37.507Z","dependency_job_id":null,"html_url":"https://github.com/benjammin4dayz/shortlink","commit_stats":null,"previous_names":["benjammin4dayz/shortlink"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/benjammin4dayz/shortlink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjammin4dayz%2Fshortlink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjammin4dayz%2Fshortlink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjammin4dayz%2Fshortlink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjammin4dayz%2Fshortlink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjammin4dayz","download_url":"https://codeload.github.com/benjammin4dayz/shortlink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjammin4dayz%2Fshortlink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28642220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"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":["api","docker","documented","link-shortener","mvc","self-hosted","shortener-service","url-shortener"],"created_at":"2024-11-12T00:12:12.181Z","updated_at":"2026-01-21T20:39:48.257Z","avatar_url":"https://github.com/benjammin4dayz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShortLink\n\nSimple, straightforward, self-hostable link shortener service built on SQLite, Express, and Node.js\n\nLoosely inspired by ulvis.net\n\n## Getting Started\n\nAfter starting the service using one of the methods outlined below, the web UI can be used to start generating shortlinks without writing any code. Simply input the full URL you want to shorten into the form, click the button, and copy the output.\n\nBy default, the Express server will run on port `3000` unless `PORT` is specified in the .env file.\n\n### Docker\n\nImages are available on [Docker Hub](https://hub.docker.com/r/benjammin4dayz/shortlink/tags)\n\n- **Example using docker run**\n\n  ```bash\n  docker run -v data:/app/data -p 3000:3000 benjammin4dayz/shortlink\n  ```\n\n- **Example using docker compose**\n\n  ```yaml\n  version: '3.9'\n  services:\n    app:\n      image: benjammin4dayz/shortlink\n      ports:\n        - 3000:3000\n      volumes:\n        - data:/app/data\n  ```\n\n### Source\n\nCheck the [tags](https://github.com/benjammin4dayz/shortlink/tags) for a specific version\n\n- **Running the development server**\n\n  ```bash\n  npm start\n  ```\n\n- **Building for production**\n\n  ```bash\n  npm run build\n  node dist/app.js\n  ```\n\n## Shortener API\n\n### GET /api/v1/shorten?url=`\u003cYOUR_LONG_URL\u003e`\n\n_Content Type: `text/plain`_\n\nPostfixing a query string with the `url=` parameter is the simplest way to interact with the API. If the provided URL is valid, a shortlink is returned in plain text. Otherwise, an empty string is returned.\n\n**Request Format**\n\n```js\nfetch('/api/v1/shorten?url=https://example.com').then(res =\u003e res.text());\n```\n\n### POST /api/v1/shorten\n\n_Content Type: `application/json`_\n\nThis method accepts and returns an object with some more insight for use in your application\n\n**Request Format**\n\n```js\nfetch('/api/v1/shorten', {\n  headers: {\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  method: 'POST',\n  body: JSON.stringify({\n    url: '\u003cYOUR_LONG_URL\u003e',\n  }),\n}).then(res =\u003e res.json());\n```\n\n**Success Response**\n\n```json\n{\n  \"message\": \"URL created successfully\",\n  \"data\": {\n    \"url\": \"\u003cYOUR_SHORT_URL\u003e\"\n  }\n}\n```\n\n**Failure Response**\n\n```json\n{ \"error\": \"That wasn't supposed to happen!\" }\n```\n\n\u003c!-- TODO:\n    Implement graceful shutdowns where db is manually closed before releasing the process\n    Server-side templating instead of static index (pug?)\n    Rate Limiting w/ express-rate-limit or express-slow-down\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjammin4dayz%2Fshortlink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjammin4dayz%2Fshortlink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjammin4dayz%2Fshortlink/lists"}