I´d like make a site with public routes ('/') and admin routes (/admin). How can I do it with rest-admin!? Thanks
Asked
Active
Viewed 146 times
1 Answers
3
You can simply use Router
for distinguishing public routes from admin ones, e.g.:
<Router>
<div>
<Route exact path="/" component={Index}/>
<Route path='/admin' component={YourAdmin}/>
</div>
</Router>
Here Index
component is you public component (e.g. homepage). And YourAdmin
component includes admin-on-rest
, e.g.:
class YourAdmin extends Component {
render() {
return (
<Admin ...>
<Resource .../>
<Resource .../>
<Resource .../>
</Admin>
)
}
}
And your admin-page can be secured with built-in admin-on-rest
functionality.

Dmytro Titov
- 2,802
- 6
- 38
- 60
-
Thanks for help Dmytro. – maurosergiosilva Jun 08 '17 at 13:25
-
You are welcome. Please, don't forget it to accept it as a right answer if it really helped. – Dmytro Titov Jun 08 '17 at 14:28