@@ -32,16 +32,39 @@ LOAD httpserver;
32
32
```
33
33
34
34
### 🔌 Usage
35
- Start the HTTP server providing the ` host ` and ` port ` parameters
35
+ Start the HTTP server providing the ` host ` , ` port ` and ` auth ` parameters.<br >
36
+ > If you want no authhentication, just pass an empty string.
37
+
38
+ #### Basic Auth
36
39
``` sql
37
- D SELECT httpserve_start(' 0.0.0.0' ,9999 );
38
- ┌─────────────────────────────────────┐
39
- │ httpserve_start(' 0.0.0.0' , 9999 ) │
40
- │ varchar │
41
- ├─────────────────────────────────────┤
42
- │ HTTP server started on 0 .0 .0 .0 :9999 │
43
- └─────────────────────────────────────┘
40
+ D SELECT httpserve_start(' localhost' , 9999 , ' user:pass' );
41
+
42
+ ┌───────────────────────────────────────────────┐
43
+ │ httpserve_start(' 0.0.0.0' , 9999 , ' user:pass' ) │
44
+ │ varchar │
45
+ ├───────────────────────────────────────────────┤
46
+ │ HTTP server started on 0 .0 .0 .0 :9999 │
47
+ └───────────────────────────────────────────────┘
44
48
```
49
+ ``` bash
50
+ curl -X POST -d " SELECT 'hello', version()" " http://user:pass@localhost:9999/"
51
+ ```
52
+
53
+ #### Token Auth
54
+ ``` sql
55
+ SELECT httpserve_start(' localhost' , 9999 , ' supersecretkey' );
56
+
57
+ ┌───────────────────────────────────────────────┐
58
+ │ httpserve_start(' 0.0.0.0' , 9999 , ' secretkey' ) │
59
+ │ varchar │
60
+ ├───────────────────────────────────────────────┤
61
+ │ HTTP server started on 0 .0 .0 .0 :9999 │
62
+ └───────────────────────────────────────────────┘
63
+ ```
64
+ ```
65
+ curl -X POST --header "X-API-Key: supersecretkey" -d "SELECT 'hello', version()" "http://localhost:9999/"
66
+ ```
67
+
45
68
46
69
#### 👉 QUERY UI
47
70
Browse to your endpoint and use the built-in quackplay interface _ (experimental)_
0 commit comments