-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8c541b
commit 5f73ad7
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,34 @@ the items from APIs by importing the module `react-admin-loopback4-adapted` and | |
the `lb4Provider` that takes as a @param the url to the backend server `http://localhost:3001`: | ||
```ruby | ||
const dataProvider = lb4Provider('http://localhost:3001'); | ||
``` | ||
**This is the content of app.js** | ||
|
||
```ruby | ||
import * as React from 'react'; | ||
import { Admin, Resource } from 'react-admin' | ||
import PostIcon from '@material-ui/icons/Book' | ||
import './App.css'; | ||
import Dashboard from './dashboard' | ||
import { ProductList, ProductCreate, Productedit } from './productlist' | ||
import { Userlist, Useredit, Usercreate } from './user' | ||
import lb4Provider from 'react-admin-loopback4-adapted' | ||
const dataProvider = lb4Provider('http://localhost:3001'); | ||
const App = () => ( | ||
<Admin dataProvider={dataProvider} dashboard={Dashboard}> | ||
<Resource name="products" list={ProductList} create={ProductCreate} | ||
edit={Productedit} icon={PostIcon} /> | ||
<Resource name="users" list={Userlist} edit={Useredit} | ||
create={Usercreate} /> | ||
</Admin> | ||
) | ||
export default App; | ||
``` | ||
|
||
**note** In this sample the authentication is not integrated we will complete it in the next tutorial | ||
|
@@ -138,6 +166,8 @@ const dataProvider = lb4Provider('http://localhost:3001'); | |
Site : https://planetconectus.com | ||
E-mail : [email protected] | ||
Phone : 00216 26 410 947 | ||
Phone : +33 970 440 431 | ||
```` | ||
|