{"id":13671910,"url":"https://github.com/iron-meteor/iron-router","last_synced_at":"2025-12-27T12:58:36.872Z","repository":{"id":9003174,"uuid":"10755256","full_name":"iron-meteor/iron-router","owner":"iron-meteor","description":"A client and server side router designed specifically for Meteor.","archived":false,"fork":false,"pushed_at":"2017-11-11T01:07:51.000Z","size":1411,"stargazers_count":1975,"open_issues_count":304,"forks_count":407,"subscribers_count":79,"default_branch":"devel","last_synced_at":"2025-05-13T09:08:37.368Z","etag":null,"topics":[],"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/iron-meteor.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-18T06:19:03.000Z","updated_at":"2025-05-05T22:15:02.000Z","dependencies_parsed_at":"2022-08-01T01:38:50.239Z","dependency_job_id":null,"html_url":"https://github.com/iron-meteor/iron-router","commit_stats":null,"previous_names":["eventedmind/iron-router"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/iron-meteor/iron-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-meteor%2Firon-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-meteor%2Firon-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-meteor%2Firon-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-meteor%2Firon-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iron-meteor","download_url":"https://codeload.github.com/iron-meteor/iron-router/tar.gz/refs/heads/devel","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-meteor%2Firon-router/sbom","scorecard":{"id":494499,"data":{"date":"2025-08-11","repo":{"name":"github.com/iron-meteor/iron-router","commit":"205bb9eaf60e97d3fa3770f1f3740dc3f8157eda"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 8/27 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'devel'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T20:08:02.056Z","repository_id":9003174,"created_at":"2025-08-19T20:08:02.056Z","updated_at":"2025-08-19T20:08:02.056Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27768961,"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","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-08-02T09:01:21.822Z","updated_at":"2025-12-16T17:47:36.633Z","avatar_url":"https://github.com/iron-meteor.png","language":"JavaScript","funding_links":[],"categories":["Routers","JavaScript"],"sub_categories":[],"readme":"Iron.Router\n==============================================================================\n\n[![Join the chat at https://gitter.im/iron-meteor/iron-router](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iron-meteor/iron-router?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nA router that works on the server and the browser, designed specifically for \u003ca href=\"https://github.com/meteor/meteor\" target=\"_blank\"\u003eMeteor\u003c/a\u003e\n\n## The Iron.Router Guide\nDetailed explanations of router features can be found in the [Guide](http://iron-meteor.github.io/iron-router/).\n\n## Installation\n\n```shell\nmeteor add iron:router\n```\n\n## Examples\nThere are several examples in the [examples folder](examples).\n\n## Quick Start\nCreate some routes in a client/server JavaScript file:\n\n```javascript\nRouter.route('/', function () {\n  this.render('MyTemplate');\n});\n\nRouter.route('/items', function () {\n  this.render('Items');\n});\n\nRouter.route('/items/:_id', function () {\n  var item = Items.findOne({_id: this.params._id});\n  this.render('ShowItem', {data: item});\n});\n\nRouter.route('/files/:filename', function () {\n  this.response.end('hi from the server\\n');\n}, {where: 'server'});\n\nRouter.route('/restful', {where: 'server'})\n  .get(function () {\n    this.response.end('get request\\n');\n  })\n  .post(function () {\n    this.response.end('post request\\n');\n  });\n\n```\n\n## Migrating from 0.9.4\n\nIron Router should be reasonably backwards compatible, but there are a few required changes that you need to know about:\n\n### Hooks\n\n`onRun` and `onBeforeAction` hooks now require you to call `this.next()`, and no longer take a `pause()` argument. So the default behaviour is reversed. For example, if you had:\n\n```javascript\nRouter.onBeforeAction(function(pause) {\n  if (! Meteor.userId()) {\n    this.render('login');\n    pause();\n  }\n});\n```\n\nYou'll need to update it to\n\n```javascript\nRouter.onBeforeAction(function() {\n  if (! Meteor.userId()) {\n    this.render('login');\n  } else {\n    this.next();\n  }\n});\n```\n\nThis is to fit better with existing route middleware (e.g. connect) APIs.\n\n### Controller Methods\n\n`controller.setLayout()` is now `controller.layout()`. Usually called as `this.layout(\"fooTemplate\")` inside a route action.\n\n### Query Parameters\nQuery parameters now get their own object on `this.params`. To access the query object you can use `this.params.query`.\n\n### Loading Hook\n\nThe `loading` hook now runs automatically on the client side if your route has a `waitOn`. As previously, you can set a global or per-route `loadingTemplate`.\n\nIf you want to setup subscriptions but not have an automatic loading hook, you can use the new `subscriptions` option, which still affects `.ready()`-ness, but doesn't force the `loading` hook.\n\n### Hook and option inheritance\n\nAll hooks and options are now fully inherited from parent controllers and the router itself as you might expect. The order of precendence is now route; controller; parent controller; router.\n\n### Route names\n\nA route's name is now accessible at `route.getName()` (previously it was `route.name`). In particular, you'll need to write `Router.current().route.getName()`.\n\n### Routes on client and server\n\nIt's not strictly required, but moving forward, Iron Router expects all routes to be declared on both client and server. This means that the client can route to the server and visa-versa.\n\n### Catchall routes\n\nIron Router now uses [path-to-regexp](https://github.com/pillarjs/path-to-regexp), which means the syntax for catchall routes has changed a little -- it's now `'/(.*)'`.\n\n### Template Lookup\n\nIf you don't explicitly set a template option on your route, and you don't\nexplicity render a template name, the router will try to automatically render a\ntemplate based on the name of the route. By default the router will look for the\nclass case name of the template.\n\nFor example, if you have a route defined like this:\n\n```javascript\nRouter.route('/items/:_id', {name: 'items.show'});\n```\n\nThe router will by default look for a template named `ItemsShow` with capital\nletters for each word and punctuation removed. If you would like to customize\nthis behavior you can set your own converter function. For example, let's say\nyou don't want any conversion. You can set the converter function like this:\n\n```javascript\nRouter.setTemplateNameConverter(function (str) { return str; });\n```\n\n## Contributing\nContributors are very welcome. There are many things you can help with,\nincluding finding and fixing bugs, creating examples for the examples folder,\ncontributing to improved design or adding features. Some guidelines below:\n\n* **Questions**: Please post to Stack Overflow and tag with `iron-router` : http://stackoverflow.com/questions/tagged/iron-router.\n\n* **New Features**: If you'd like to work on a feature,\n  start by creating a 'Feature Design: Title' issue. This will let people bat it\n  around a bit before you send a full blown pull request. Also, you can create\n  an issue to discuss a design even if you won't be working on it.\n\n* **Bugs**: If you think you found a bug, please create a \"reproduction.\" This is a small project that demonstrates the problem as concisely as possible. The project should be cloneable from Github. Any bug reports without a reproduction that don't have an obvious solution will be marked as \"awaiting-reproduction\" and closed after one week. Want more information on creating reproductions? Watch this video: https://www.eventedmind.com/feed/github-issues-and-reproductions.\n\n###  Working Locally\nThis is useful if you're contributing code to iron-router.\n\n  1. Set up a local packages folder\n  2. Add the PACKAGE_DIRS environment variable to your .bashrc file\n    - Example: `export PACKAGE_DIRS=\"/Users/cmather/code/packages\"`\n    - Screencast: https://www.eventedmind.com/posts/meteor-versioning-and-packages\n  3. Clone the repository into your local packages directory\n  4. Add iron-router just like any other meteor core package like this: `meteor\n     add iron:router`\n\n```bash\n\u003e git clone https://github.com/EventedMind/iron-router.git /Users/cmather/code/packages/iron:router\n\u003e cd my-project\n\u003e meteor add iron:router\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firon-meteor%2Firon-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firon-meteor%2Firon-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firon-meteor%2Firon-router/lists"}