{"id":32248234,"url":"https://github.com/erikringsmuth/app-router","last_synced_at":"2026-03-10T09:40:11.081Z","repository":{"id":18676951,"uuid":"21885551","full_name":"erikringsmuth/app-router","owner":"erikringsmuth","description":"Router for Web Components","archived":false,"fork":false,"pushed_at":"2018-01-12T17:29:18.000Z","size":9814,"stargazers_count":608,"open_issues_count":52,"forks_count":83,"subscribers_count":39,"default_branch":"master","last_synced_at":"2026-01-23T12:35:57.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://erikringsmuth.github.io/app-router/","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/erikringsmuth.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-16T03:45:04.000Z","updated_at":"2025-05-22T22:19:12.000Z","dependencies_parsed_at":"2022-09-09T07:30:10.293Z","dependency_job_id":null,"html_url":"https://github.com/erikringsmuth/app-router","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/erikringsmuth/app-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikringsmuth%2Fapp-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikringsmuth%2Fapp-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikringsmuth%2Fapp-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikringsmuth%2Fapp-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikringsmuth","download_url":"https://codeload.github.com/erikringsmuth/app-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikringsmuth%2Fapp-router/sbom","scorecard":{"id":381203,"data":{"date":"2025-08-11","repo":{"name":"github.com/erikringsmuth/app-router","commit":"6ad9c9ac2d877d1e4a64b6f883baa3991a6200ed"},"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":"Code-Review","score":2,"reason":"Found 6/22 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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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 'master'"],"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 17 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-18T15:29:44.270Z","repository_id":18676951,"created_at":"2025-08-18T15:29:44.271Z","updated_at":"2025-08-18T15:29:44.271Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30328902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: 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":[],"created_at":"2025-10-22T17:41:47.922Z","updated_at":"2026-03-10T09:40:11.021Z","avatar_url":"https://github.com/erikringsmuth.png","language":"HTML","funding_links":[],"categories":["Components"],"sub_categories":["Lego","Smart HTML Elements"],"readme":"## Router for Web Components\n\u003e Works with [Polymer](https://www.polymer-project.org/), [X-Tag](http://www.x-tags.org/), and natively.\n\u003e\n\u003e [erikringsmuth.github.io/app-router](https://erikringsmuth.github.io/app-router/)\n\nManage page state. Lazy-load content. Data-bind path variables and query parameters. Use multiple layouts. Navigate with `hashchange` and HTML5 `pushState`. Animate transitions using `core-animated-pages`.\n\n[Download](https://github.com/erikringsmuth/app-router/archive/master.zip) or run `bower install app-router --save`.\n\n## Configuration\n\nDefine how URLs map to pages.\n\n```html\n\u003c!doctype html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eApp Router\u003c/title\u003e\n    \u003clink rel=\"import\" href=\"/bower_components/app-router/app-router.html\"\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003capp-router\u003e\n      \u003c!-- matches an exact path --\u003e\n      \u003capp-route path=\"/home\" import=\"/pages/home-page.html\"\u003e\u003c/app-route\u003e\n\n      \u003c!-- matches using a wildcard --\u003e\n      \u003capp-route path=\"/customer/*\" import=\"/pages/customer-page.html\"\u003e\u003c/app-route\u003e\n\n      \u003c!-- matches using a path variable --\u003e\n      \u003capp-route path=\"/order/:id\" import=\"/pages/order-page.html\"\u003e\u003c/app-route\u003e\n\n      \u003c!-- matches a pattern like '/word/number' --\u003e\n      \u003capp-route path=\"/^\\/\\w+\\/\\d+$/i\" regex import=\"/pages/regex-page.html\"\u003e\u003c/app-route\u003e\n\n      \u003c!-- matches everything else --\u003e\n      \u003capp-route path=\"*\" import=\"/pages/not-found-page.html\"\u003e\u003c/app-route\u003e\n    \u003c/app-router\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Navigation\n\nClick links or call `router.go()`.\n\n```html\n\u003c!-- hashchange --\u003e\n\u003ca href=\"#/home\"\u003eHome\u003c/a\u003e\n\n\u003c!-- pushState() --\u003e\n\u003ca is=\"pushstate-anchor\" href=\"/home\"\u003eHome\u003c/a\u003e\n\n\u003c!-- router.go(path, options) --\u003e\n\u003cscript\u003e\n  document.querySelector('app-router').go('/home');\n\u003c/script\u003e\n```\n\nThe router listens to `popstate` and `hashchange` events. Changing the URL will find the first `app-route` that matches, load the element or template, and replace the current view.\n\n#### hashchange\nClicking `\u003ca href=\"#/home\"\u003eHome\u003c/a\u003e` will fire a `hashchange` event and tell the router to load the first route that matches `/home`. You don't need to handle the event in your Javascript. Hash paths `#/home` match routes without the hash `\u003capp-route path=\"/home\"\u003e`.\n\n#### pushState\nYou can use the [pushstate-anchor](https://github.com/erikringsmuth/pushstate-anchor) or [html5-history-anchor](https://github.com/erikringsmuth/html5-history-anchor) to extend `\u003ca\u003e` tags with the HTML5 history API.\n\n```html\n\u003ca is=\"pushstate-anchor\" href=\"/home\"\u003eHome\u003c/a\u003e\n```\n\nThis will call `pushState()` and dispatch a `popstate` event.\n\n#### go(path, options)\nYou can call the router from Javascript to navigate imperatively.\n\n```js\ndocument.querySelector('app-router').go('/home');\n// or\ndocument.querySelector('app-router').go('/home', {replace: true});\n```\n\nIf you use `go(path, options)` you should also set the mode to `hash` or `pushstate` on the router.\n\n```html\n\u003capp-router mode=\"auto|pushstate|hash\"\u003e\n  \u003c!-- app-routes --\u003e\n\u003c/app-router\u003e\n```\n\n## Data Binding\nPath variables and query parameters automatically attach to the element's attributes.\n\n``` html\n\u003c!-- url --\u003e\n\u003ca is=\"pushstate-anchor\" href=\"/order/123?sort=ascending\"\u003eOrder 123\u003c/a\u003e\n\n\u003c!-- route --\u003e\n\u003capp-route path=\"/order/:orderId\" import=\"/pages/order-page.html\"\u003e\u003c/app-route\u003e\n\n\u003c!-- will bind 123 to the page's `orderId` attribute and \"ascending\" to the `sort` attribute --\u003e\n\u003corder-page orderId=\"123\" sort=\"ascending\"\u003e\u003c/order-page\u003e\n```\n\nIf you're using Polymer, you can also bind path variables and query parameters to templates.\n```html\n\u003capp-route path=\"/order/:orderId\"\u003e\n  \u003ctemplate\u003e\n    \u003cp\u003eYour order number is {{orderId}}\u003c/p\u003e\n  \u003c/template\u003e\n\u003c/app-route\u003e\n```\n\nSee it in action [here](https://erikringsmuth.github.io/app-router/#/databinding/1337?queryParam1=Routing%20with%20Web%20Components!).\n\n## \u0026lt;app-route\u0026gt; options\n\n#### import a custom element\nLazy-load a custom element.\n\n```html\n\u003capp-route path=\"/customer/:customerId\" import=\"/pages/customer-page.html\" [element=\"customer-page\"]\u003e\u003c/app-route\u003e\n```\n\nYou only need to set the `element` attribute if the element's name is different than the file name.\n\n#### pre-loaded custom element\nInclude the `element=\"element-name\"` attribute on the route to use a pre-loaded custom element. This is how you use bundled (vulcanized) custom elements.\n\n```html\n\u003chead\u003e\n  \u003clink rel=\"import\" href=\"/pages/page-bundle.html\"\u003e\n\u003c/head\u003e\n\u003capp-router\u003e\n  \u003capp-route path=\"/customer/:customerId\" element=\"customer-page\"\u003e\u003c/app-route\u003e\n\u003c/app-router\u003e\n```\n\n#### import template\nYou can import a `\u003ctemplate\u003e` instead of a custom element. Just include the `template` attribute.\n\n```html\n\u003capp-route path=\"/example\" import=\"/pages/template-page.html\" template\u003e\u003c/app-route\u003e\n```\n\n#### inline template\nFinally, you can in-line a `\u003ctemplate\u003e` like this.\n\n```html\n\u003capp-route path=\"/example\"\u003e\n  \u003ctemplate\u003e\n    \u003cp\u003eInline template FTW!\u003c/p\u003e\n  \u003c/template\u003e\n\u003c/app-route\u003e\n```\n\n#### regular expressions\nInclude the `regex` attribute to match on a regular expression. The format is the same as a JavaScript regular expression.\n\n```html\n\u003c!-- matches a pattern like '/word/number' --\u003e\n\u003capp-route path=\"/^\\/\\w+\\/\\d+$/i\" regex import=\"/pages/regex-page.html\"\u003e\u003c/app-route\u003e\n```\n\n#### redirect\nA route can redirect to another path.\n\n```html\n\u003capp-router mode=\"pushstate\"\u003e\n  \u003capp-route path=\"/home\" import=\"/pages/home-page.html\"\u003e\u003c/app-route\u003e\n  \u003capp-route path=\"*\" redirect=\"/home\"\u003e\u003c/app-route\u003e\n\u003c/app-router\u003e\n```\n\nWhen you use `redirect` you should also set `mode=\"hash|pushstate\"` on the `app-router`.\n\n## \u0026lt;app-router\u0026gt; options\n\n#### mode\nOne set of routes will match regular paths `/` and hash paths `#/`. You can force a specific mode with `mode=\"auto|hash|pushstate\"`.\n\n```html\n\u003capp-router mode=\"pushstate\"\u003e\n  \u003c!-- always ignore the hash and match on the path --\u003e\n\u003c/app-router\u003e\n```\n\nWhen left in `auto`, redirects and `go(path, options)` will use hash paths.\n\n#### trailing slashes\nBy default `/home` and `/home/` are treated as separate routes. You can configure the router to ignore trailing slashes with `trailingSlash=\"ignore\"`.\n```html\n\u003capp-router trailingSlash=\"ignore\"\u003e\n  \u003c!-- matches '/home' and '/home/' --\u003e\n  \u003capp-route path=\"/home\" import=\"/pages/home-page.html\"\u003e\u003c/app-route\u003e\n\u003c/app-router\u003e\n```\n\n## Demo Site \u0026 Example Setup\nCheck out the `app-router` in action at [erikringsmuth.github.io/app-router](https://erikringsmuth.github.io/app-router/).\n\nYou can download an example setup here https://github.com/erikringsmuth/app-router-examples to get running locally.\n\nExamples showing `app-router` and `flatiron-director` versus no router https://github.com/erikringsmuth/polymer-router-demos.\n\n## Breaking Changes\nCheck the [change log](https://github.com/erikringsmuth/app-router/blob/master/changelog.md) for breaking changes in major versions.\n\n## Build, Test, and Debug [![Build Status](https://travis-ci.org/erikringsmuth/app-router.png?branch=master)](https://travis-ci.org/erikringsmuth/app-router)\nSource files are under the `src` folder. The build process writes to the root directory. The easiest way to debug is to include the source script rather than the minified HTML import.\n```html\n\u003cscript src=\"/bower_components/app-router/src/app-router.js\"\u003e\u003c/script\u003e\n```\n\nTo build:\n- Run `bower install` and `npm install` to install dev dependencies\n- Lint, test, build, and minify code with `gulp`\n- Manually run functional tests in the browser by starting a static content server (node `http-server` or `python -m SimpleHTTPServer`) and open [http://localhost:8080/tests/functional-tests/](http://localhost:8080/tests/functional-tests/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikringsmuth%2Fapp-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikringsmuth%2Fapp-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikringsmuth%2Fapp-router/lists"}