Skip to content

Commit

Permalink
Add docs for connecting to a real API server for developing web local…
Browse files Browse the repository at this point in the history
…ly (#4483)

Signed-off-by: Kenta Kozuka <[email protected]>
  • Loading branch information
kentakozuka authored Jul 11, 2023
1 parent 06b8296 commit b3fbc43
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ make run/web
The app will be available at http://localhost:9090.

### Connect Real API server
If you want to connect the real API server, additional settings on the `.env` file are needed.
If you want to connect to a real API server, additional settings on the `.env` file are needed.

First, create your own `.env` file based on the `.env.example` file.

Expand All @@ -58,9 +58,15 @@ Set `ENABLE_MOCK` to false explicitly.
ENABLE_MOCK=false
```

If API server has authorization by cookie, set `API_COOKIE` to the cookie you have already obtained through other clients
If the API server has authorization by cookie, set `API_COOKIE` to the cookie you have already obtained through other clients
(typically you need to send some kind of request from an authenticated client and peek at the request header in some way).

```
API_COOKIE={COOKIE}
```

Take Chrome for example;
1. Access to the existing UI.
2. Open the developer tools and go to the network panel.
3. Find the `GetMe` request and select it.
4. Copy the whole value of the `Cookie` in "Request Headers" and paste it to `API_COOKIE={COOKIE}` in the `.env` file.

0 comments on commit b3fbc43

Please sign in to comment.