{"id":17498165,"url":"https://github.com/timreynolds/micro-redirect","last_synced_at":"2025-04-23T01:56:30.511Z","repository":{"id":38272732,"uuid":"84666805","full_name":"timReynolds/micro-redirect","owner":"timReynolds","description":"A redirect function for Zeit's micro","archived":false,"fork":false,"pushed_at":"2023-01-09T23:00:40.000Z","size":414,"stargazers_count":13,"open_issues_count":12,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T01:56:20.835Z","etag":null,"topics":["api","javascript","micro","redirect"],"latest_commit_sha":null,"homepage":null,"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/timReynolds.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}},"created_at":"2017-03-11T17:14:33.000Z","updated_at":"2024-02-08T19:40:46.000Z","dependencies_parsed_at":"2023-02-08T15:46:12.582Z","dependency_job_id":null,"html_url":"https://github.com/timReynolds/micro-redirect","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fmicro-redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fmicro-redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fmicro-redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fmicro-redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timReynolds","download_url":"https://codeload.github.com/timReynolds/micro-redirect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250354304,"owners_count":21416751,"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":["api","javascript","micro","redirect"],"created_at":"2024-10-19T16:10:33.404Z","updated_at":"2025-04-23T01:56:30.497Z","avatar_url":"https://github.com/timReynolds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"_**Micro Redirect -**_\n\nA redirect function for Zeit's [micro](https://github.com/zeit/micro)\n\n[![Build Status](https://travis-ci.org/timReynolds/micro-redirect.svg?branch=master)](https://travis-ci.org/timreynolds/micro-redirect)\n[![Maintainability](https://api.codeclimate.com/v1/badges/0d5e4eb0820d66791e2d/maintainability)](https://codeclimate.com/github/timReynolds/micro-redirect/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/0d5e4eb0820d66791e2d/test_coverage)](https://codeclimate.com/github/timReynolds/micro-redirect/test_coverage)\n\n## Usage\n\nFirstly, install it:\n\n```bash\nnpm install --save micro-redirect\n```\n\nThen import it like this:\n\n```js\nconst redirect = require(\"micro-redirect\");\n```\n\nAnd use it the same you'd use Zeit's send:\n\n```js\nmodule.exports = async (req, res) =\u003e {\n  const statusCode = 302;\n  const location = \"http://github.com\";\n\n  redirect(res, statusCode, location);\n};\n```\n\n#### API\n\n**`redirect(res, statusCode, location)`**\n\n- `statusCode` is a `Number` with the HTTP redirect code, and must always be supplied.\n- `location` is a `String` used to set the res header location, and must always be supplied.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimreynolds%2Fmicro-redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimreynolds%2Fmicro-redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimreynolds%2Fmicro-redirect/lists"}