1
- # A simple webfrontend to be self-hosted
1
+ # A simple web frontend to be self-hosted
2
2
3
3
## Run frontend only in dev mode
4
4
@@ -7,31 +7,43 @@ cd frontend
7
7
flutter run -d chrome
8
8
```
9
9
10
- ## Build the frontend to be served by rust
10
+ ## Build the frontend to be served by Rust
11
11
12
12
``` bash
13
13
flutter build web
14
14
```
15
15
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
17
27
18
28
``` bash
19
29
cargo run -- --cert-dir certs --data-dir ../data
20
30
```
21
31
22
- The webinterface will be reachable under ` https://localhost:3001 `
32
+ The web interface will be reachable under ` http://localhost:3001 `
33
+
34
+ ### Troubleshooting
23
35
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.
25
37
26
- ## How to use curl with webapp
38
+ ## How to interact with the backend with ` curl `
27
39
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:
29
41
30
42
``` bash
31
43
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
32
44
```
33
45
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:
35
47
36
48
``` bash
37
49
curl -b .cookie-jar.txt -c .cookie-jar.txt http://localhost:3001/api/balance
0 commit comments