{"id":28711715,"url":"https://github.com/curveball/links","last_synced_at":"2025-06-14T22:10:24.770Z","repository":{"id":42668881,"uuid":"249120378","full_name":"curveball/links","owner":"curveball","description":"Weblinking middelware for Curveball","archived":false,"fork":false,"pushed_at":"2024-11-11T21:26:27.000Z","size":799,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-23T13:38:23.800Z","etag":null,"topics":["curveball","hal","hateoas","http","links","middleware","rest","weblinking"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/curveball.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-03-22T05:35:59.000Z","updated_at":"2024-11-11T21:26:31.000Z","dependencies_parsed_at":"2024-01-15T04:36:12.821Z","dependency_job_id":"dc8eeb7e-8a37-4e02-977d-37bf76f7b109","html_url":"https://github.com/curveball/links","commit_stats":{"total_commits":47,"total_committers":3,"mean_commits":"15.666666666666666","dds":0.1063829787234043,"last_synced_commit":"2113bd83448778623bb02ec49015c1c48ede030f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":"curveball/new-package","purl":"pkg:github/curveball/links","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curveball%2Flinks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curveball%2Flinks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curveball%2Flinks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curveball%2Flinks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curveball","download_url":"https://codeload.github.com/curveball/links/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curveball%2Flinks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259890461,"owners_count":22927374,"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":["curveball","hal","hateoas","http","links","middleware","rest","weblinking"],"created_at":"2025-06-14T22:10:23.730Z","updated_at":"2025-06-14T22:10:24.755Z","avatar_url":"https://github.com/curveball.png","language":"TypeScript","readme":"Curveball Links middleware\n==========================\n\nThis [Curveball][1] middleware helps you parse and generate HTTP Weblinks.\n\nAny links passed in a request via the [`Link`][3] header will now be exposed in\n`ctx.request`.  Similarly, if a link was set in `ctx.response.links`, it will\nautomatically be encoded as a `Link` header in the HTTP response.\n\nLastly, if the request body was a [HAL][2] object, and it has a `_links`\nproperty, these links will also be added to `ctx.response.links`.\n\nInstallation\n------------\n\n    npm i @curveball/links\n\nUsage\n-----\n\n\n```typescript\nimport { Application, Context } from '@curveball/core';\nimport links from '@curveball/links';\nimport bodyParser from '@curveball/bodyparser';\n\n\nconst app = new Application();\n\n// If you would like to parse HAL links, the bodyParser must be loaded first.\napp.use(bodyParser());\n\napp.use(links());\n\napp.use( (ctx: Context) =\u003e {\n\n  // Read a Link from a HAL body or Link header\n  console.log(ctx.request.links.get('author'));\n\n  // Write a Link header\n  ctx.response.links.set({ rel: 'alternate' , type: 'text/csv', href: '/export.csv'});\n\n});\n```\n\n[1]: https://curveballjs.org/\n[2]: https://tools.ietf.org/html/draft-kelly-json-hal-08\n[3]: https://tools.ietf.org/html/rfc8288\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurveball%2Flinks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurveball%2Flinks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurveball%2Flinks/lists"}