Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
use online jsonplaceholder
Browse files Browse the repository at this point in the history
  • Loading branch information
adr1enbe4udou1n committed Jul 11, 2020
1 parent a8db97c commit 1926b7a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
12 changes: 9 additions & 3 deletions docs/guide/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ Check [API Platform tutorial](#api-platform) or more advanced [Laravel guide](la

### Backend API

First you will need a functional local API in order to test Vtec Admin. We will use JSONPlaceholder as DB sample but it's really advised to run it locally instead of current online version for preventing slow response. Don't worry it's done in less than 2 minutes in 3 steps :
First you'll need a functional API server in order to play with Vtec Admin. We will use JSONPlaceholder as API json server hosted on [dedicated Okami101 server](https://jsonplaceholder.okami101.io).

Note as it's a read-only server. However all non-GET HTTP request methods are still available although all create/update/delete operations will not be reflected on server-side.

This simple server provides multiple CRUD API endpoints for multiple resources as `posts`, `comments`, `users`, etc. You can find a format description of each route [here](https://github.com/typicode/json-server#routes). Vtec Admin will allows us to implement an nice material admin UI for manage them as quickest as possible.

::: tip RUN LOCALLY
If you want truly writeable API CRUD server, it's very easy to launch your own JSON server locally by this simple steps :

```bash
npm install -g json-server
Expand All @@ -24,8 +31,7 @@ json-server --watch data.json
```

And voilà ! You should have a working API. Example of endpoint : [http://localhost:3000/posts?_start=0&_end=15](http://localhost:3000/posts?_start=0&_end=15).

This simple server provides multiple CRUD API endpoints for multiple resources as `posts`, `comments`, `users`, etc. You can find a format description of each route [here](https://github.com/typicode/json-server#routes). Vtec Admin will allows us to implement an nice material admin UI for manage them as quickest as possible.
:::

### Admin UI

Expand Down
17 changes: 2 additions & 15 deletions examples/tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,15 @@ Also a good way to quickly test Vtec Admin with a fake backend.

## How to run

### Backend API

It's really advised to run placeholder backend on local instead of current online version for no saturate it. Don't worry it's done in less than 5 minutes.

Download this [Json file DB](https://github.com/typicode/jsonplaceholder/raw/master/data.json), Then start the terminal from where you put the file and do next steps :

```bash
npm install -g json-server
json-server --watch data.json
```

And voilà ! You should have a working API. Example of endpoint : [http://localhost:3000/posts?_start=0&_end=15](http://localhost:3000/posts?_start=0&_end=15).

### Admin UI

```bash
yarn
yarn serve
```

This should run at [http://localhost:8080](http://localhost:8080).

> This tutorial relies on a read-only personal hosted [JSONPlaceholder](https://jsonplaceholder.okami101.io) API server.
## License

This project is open-sourced software licensed under the [MIT license](https://adr1enbe4udou1n.mit-license.org).
3 changes: 2 additions & 1 deletion examples/tutorial/src/plugins/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Vue.use(VtecAdmin);
/**
* Axios instance
*/
const baseURL = process.env.VUE_APP_API_URL || "http://localhost:3000";
const baseURL =
process.env.VUE_APP_API_URL || "https://jsonplaceholder.okami101.io";

const http = axios.create({
baseURL,
Expand Down

0 comments on commit 1926b7a

Please sign in to comment.