You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `http` sub-command in LINO is used to start an HTTP server that facilitates the interaction with LINO's data management functionalities via HTTP requests. This allows users to pull and push data using common HTTP methods like `GET`, `POST`, and `PATCH`.
574
+
575
+
To start the server, you can use the command:
576
+
577
+
```bash
578
+
lino http --port 8080
579
+
```
580
+
581
+
Where `--port` specifies the port on which the server will listen. The default port is `8000` if not specified.
582
+
583
+
### Example of using the HTTP server:
584
+
585
+
Start the Server:
586
+
587
+
```bash
588
+
lino http --port 8080
589
+
```
590
+
591
+
Make an HTTP GET Request to Pull Data:
592
+
593
+
You can use curl or any other HTTP client to interact with the server. For instance, to pull data from the source, you would use:
594
+
595
+
```bash
596
+
curl http://localhost:8080/api/v1/data/source
597
+
```
598
+
599
+
This command retrieves data from the specified source via the LINO HTTP interface.
600
+
601
+
Others HTTP methods are available in the tests [here](tests/suites/http/pull.yml)
602
+
603
+
### CORS Configuration
604
+
605
+
The HTTP server also supports Cross-Origin Resource Sharing (CORS), which is essential for managing resource access from different origins. You can enable and configure CORS to fit your needs:
606
+
-`--cors-headers strings`: Allowed CORS headers (default `[Content-Type,Authorization]`)
607
+
-`--cors-methods strings`: Allowed CORS methods (default `[GET,POST,OPTIONS,DELETE]`)
608
+
-`--cors-origins strings`: Allowed CORS origins (e.g. `http://localhost:3000`) (default `[*]`)
609
+
-`--enable-cors`: Enable CORS support
610
+
611
+
These flags allow you to specify which headers, methods, and origins are allowed, providing flexible control over your server's security and accessibility.
0 commit comments