-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create REST routes on SB Admin React Starter Kit #66
Comments
import { resolve } from 'universal-router'
const routes = {
path: '/users',
children: [
{ path: '/', action() { return 'Users' } },
{ path: '/create', action() { return 'Create User' } },
{ path: '/add', action() { return 'Add User' } },
{ path: '/:id', action(context) { return `User #${context.params.id}` } },
]
}
resolve(routes, '/users/1').then(result => {
document.body.innerHTML = result
}) Playground: https://jsfiddle.net/frenzzy/pg0ouyxm/ |
Hi frenzzy, Thanks for your response, how to implemet with SB Admin React Starter Kit ? Thanks |
Add by analogy with other routes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi koistya, I'm newbie in React JS, I'm using SB Admin React Starter Kit to create my app, I wish to create kind REST routes :
http://example.com/users
http://example.com/users/1
http://example.com/users/create
http://example.com/users/add
…
But I can't figure out how to make it, may you can help me to solve my problem ?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38907533-how-to-create-rest-routes-on-sb-admin-react-starter-kit?utm_campaign=plugin&utm_content=tracker%2F18115217&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F18115217&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: