Skip to content

Commit 07581c9

Browse files
luckysoriholzeis
authored andcommitted
chore(webapp): Clarify README.md
In particular, how to run the `webapp` with and without TLS. And where to find the website based on that.
1 parent fbc0365 commit 07581c9

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

webapp/README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A simple webfrontend to be self-hosted
1+
# A simple web frontend to be self-hosted
22

33
## Run frontend only in dev mode
44

@@ -7,31 +7,43 @@ cd frontend
77
flutter run -d chrome
88
```
99

10-
## Build the frontend to be served by rust
10+
## Build the frontend to be served by Rust
1111

1212
```bash
1313
flutter build web
1414
```
1515

16-
## Run the rust app
16+
## Run the Rust app
17+
18+
### With TLS
19+
20+
```bash
21+
cargo run -- --cert-dir certs --data-dir ../data --secure
22+
```
23+
24+
The web interface will be reachable under `https://localhost:3001`.
25+
26+
### Without TLS
1727

1828
```bash
1929
cargo run -- --cert-dir certs --data-dir ../data
2030
```
2131

22-
The webinterface will be reachable under `https://localhost:3001`
32+
The web interface will be reachable under `http://localhost:3001`
33+
34+
### Troubleshooting
2335

24-
Note: if you can't see anything, you probably forgot to run `flutter build web` before
36+
If you can't see anything, you probably forgot to run `flutter build web` before.
2537

26-
## How to use curl with webapp
38+
## How to interact with the backend with `curl`
2739

28-
We need to store cookies between two curl calls, for that you can use the cookie jar of curl:
40+
We need to store cookies between `curl` calls. For that you can use the `curl`'s cookie jar:
2941

3042
```bash
3143
curl -b .cookie-jar.txt -c .cookie-jar.txt -X POST http://localhost:3001/api/login -d '{ "password": "satoshi" }' -H "Content-Type: application/json" -v
3244
```
3345

34-
This will read and store the cookies in `.cookie-jar.txt`. So on the next call you can reference it the same way, e.g.
46+
This will read and store the cookies in `.cookie-jar.txt`. So on the next call you can reference it the same way:
3547

3648
```bash
3749
curl -b .cookie-jar.txt -c .cookie-jar.txt http://localhost:3001/api/balance

0 commit comments

Comments
 (0)