Skip to content

Commit 125f59c

Browse files
committed
fix: @toofff review
1 parent 6ddfc80 commit 125f59c

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

client-generator/nextjs.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Create a `tsconfig.json` file to store Typescript configuration:
7373
Install required dependencies:
7474

7575
```bash
76-
$ yarn add lodash @types/lodash isomorphic-unfetch
76+
$ yarn add lodash.get lodash.has @types/lodash isomorphic-unfetch
7777
```
7878

7979
## Starting the Project
@@ -88,14 +88,18 @@ and access it through `http://localhost:3000`
8888
## Generating Routes
8989

9090
```bash
91-
$ npx @api-platform/client-generator https://demo.api-platform.com src/ -g next --resource book
91+
$ npx @api-platform/client-generator https://demo.api-platform.com src/ --generator next --resource book
9292
# Replace the URL by the entrypoint of your Hydra-enabled API
9393
```
9494

9595
> Note: Omit the resource flag to generate files for all resource types exposed by the API.
9696
9797
If your express server is compatible with the `custom-server-express` Next.js example, you can use the `server-path` flag to specify path to the server file. Routes will be added automatically to this file, otherwise, you will receive some hints on how to them to your own custom server.
9898

99+
```bash
100+
$ npx @api-platform/client-generator https://demo.api-platform.com src/ --generator next --server-path ./server.js
101+
```
102+
99103
Go to `https://localhost:3000/books/` to start using your app.
100104
That's it!
101105

client-generator/react-native.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $ yarn add redux react-redux redux-thunk redux-form react-native-elements react-
2727
In the app directory, generate the files for the resource you want:
2828

2929
```bash
30-
$ npx @api-platform/client-generator https://demo.api-platform.com . -g react-native --resource book
30+
$ npx @api-platform/client-generator https://demo.api-platform.com . --generator react-native --resource book
3131
```
3232

3333
Replace the URL with the entrypoint of your Hydra-enabled API.

client-generator/typescript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The TypeScript Generator allows you to create [TypeScript interfaces](https://ww
55
To do so, run the client generator:
66

77
```bash
8-
$ npx @api-platform/client-generator -g typescript https://demo.api-platform.com src/ --resource foo
8+
$ npx @api-platform/client-generator --generator typescript https://demo.api-platform.com src/ --resource foo
99
# Replace the URL by the entrypoint of your Hydra-enabled API
1010
# "src/" represents where the interfaces will be generated
1111
# Omit the resource flag to generate files for all resource types exposed by the API
@@ -20,7 +20,7 @@ NOTE: If you are not sure what the entrypoint is, see [Troubleshooting](troubles
2020
Assuming you have 2 resources in your application, `Foo` and `Bar`, when you run
2121

2222
```bash
23-
npx @api-platform/client-generator -g typescript https://demo.api-platform.com src/
23+
npx @api-platform/client-generator --generator typescript https://demo.api-platform.com src/
2424
```
2525

2626
you will obtain 2 `.ts` files arranged as following:

client-generator/vuejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Reference the Bootstrap CSS stylesheet in `public/index.html` (optional):
2727

2828
In the app directory, generate the files for the resource you want:
2929

30-
$ generate-api-platform-client -g vue https://demo.api-platform.com src/ --resource foo
30+
$ generate-api-platform-client --generator vue https://demo.api-platform.com src/ --resource foo
3131
# Replace the URL by the entrypoint of your Hydra-enabled API
3232
# Omit the resource flag to generate files for all resource types exposed by the API
3333

0 commit comments

Comments
 (0)