{"id":18799561,"url":"https://github.com/l2silver/react-router-rest","last_synced_at":"2026-01-02T20:30:15.818Z","repository":{"id":57343866,"uuid":"63916901","full_name":"l2silver/react-router-rest","owner":"l2silver","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-23T17:24:08.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T04:35:41.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l2silver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-22T02:25:45.000Z","updated_at":"2017-03-09T11:53:58.000Z","dependencies_parsed_at":"2022-09-12T06:30:31.232Z","dependency_job_id":null,"html_url":"https://github.com/l2silver/react-router-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2silver%2Freact-router-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2silver%2Freact-router-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2silver%2Freact-router-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l2silver%2Freact-router-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l2silver","download_url":"https://codeload.github.com/l2silver/react-router-rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727879,"owners_count":19687262,"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":[],"created_at":"2024-11-07T22:15:46.137Z","updated_at":"2026-01-02T20:30:15.733Z","avatar_url":"https://github.com/l2silver.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"React Router Rest\n=========================\n[![Coverage Status](https://coveralls.io/repos/github/l2silver/react-router-rest/badge.svg?branch=master)](https://coveralls.io/github/l2silver/react-router-rest?branch=master)\n[![Build Status](https://travis-ci.org/l2silver/react-router-rest.svg?branch=master)](https://travis-ci.org/l2silver/react-router-rest)\n\nSimple standardized react router routes with wrapper support\n\n## Installation\n\n```\nnpm install --save react-router-rest\n```\n\n## Example\n\n../components/Users/Create.jsx\n``` \nexport function Create(props){\n\treturn \u003cdiv/\u003e\n}\n```\n../components/Users/Base.jsx\n```\nexport function Base(props){\n\treturn \u003cdiv\u003e{props.children}\u003c/div\u003e\n}\n```\ncomponents/Users/index.jsx\n```\nexport function Index(props){\n\treturn \u003cdiv/\u003e\n}\nexport * from './Create\nexport * from './Base\n```\n../components/Routes/index.jsx\n```\nimport React from 'react';\nimport { Router, Route, IndexRoute, browserHistory } from 'react-router';\nimport { restRoutes, setRestRoutes } from 'react-router-rest';\nimport * as Users from '../Users';\nsetRestRoutes({React, IndexRoute, Route});\n\u003cRouter history={browserHistory}\u003e\n\t\u003cRoute path=\"/\"\u003e\n\t\t{restRoutes(Users, {name: 'users'})}\n\t\u003c/Route\u003e\n\u003c/Router\u003e\n====\u003e\n\u003cRouter history={browserHistory}\u003e\n\t\u003cRoute path=\"/\"\u003e\n\t\t\u003cRoute path=\"users/\" component={Users.Base}\u003e\n\t\t    \u003cIndexRoute component={Users.Index}/\u003e\n\t\t    \u003cRoute path=\"create\" component={Users.Create}/\u003e\n\t    \u003c/Route\u003e\n\t\u003c/Route\u003e\n\u003c/Router\u003e\n```\n## How it works\nBase components are placed in the root component\nIndex components are placed in the IndexRoute component\nEverything else is placed in a regular route, the path being the lower case version of the component name ie. Create = create, Example = example\n## Wrapper Support\nReact Router Redux also supports wrappers with the optional wrappers property in options  \nThere are 2 wrapper settings\n* base\n* ComponentName  \n\nThe base property lets you define a wrapper for every route in that base route.\nThe ComponentName property both allows you to define wrappers for specific components, and allows you to skip wrappers for certain paths\n#### Example\n../components/Routes/index.jsx\n```\nimport React from 'react';\nimport { Router, Route, IndexRoute, browserHistory } from 'react-router';\nimport { restRoutes, setRestRoutes } from 'react-router-rest';\nimport * as Users from '../Users';\nsetRestRoutes({React, IndexRoute, Route});\nconst wrappers = {\n    base: (Component)=\u003e\u003cdiv\u003e\u003cComponent\u003e\u003c/div\u003e\n    Create: (Component)=\u003e\u003cspan\u003e\u003cComponent\u003e\u003c/span\u003e\n    Index: 'skip'\n}\n\u003cRouter history={browserHistory}\u003e\n\t\u003cRoute path=\"/\"\u003e\n\t\t{restRoutes(Users, {name: 'users', wrappers})}\n\t\u003c/Route\u003e\n\u003c/Router\u003e\n====\u003e\n\u003cRouter history={browserHistory}\u003e\n\t\u003cRoute path=\"/\"\u003e\n\t\t\u003cRoute path=\"users/\" component={Users.Base}\u003e\n\t\t    \u003cIndexRoute component={Users.Index}/\u003e\n\t\t    \u003cRoute path=\"create\" component={wrappers.create(Users.Create)}/\u003e\n\t\t    \u003cRoute path=\"edit\" component={wrappers.base(Users.Edit)}/\u003e\n\t    \u003c/Route\u003e\n\t\u003c/Route\u003e\n\u003c/Router\u003e\n```\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl2silver%2Freact-router-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl2silver%2Freact-router-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl2silver%2Freact-router-rest/lists"}