2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-12-24 14:31:51 +01:00

add roapi

This commit is contained in:
kev
2024-07-19 14:42:18 +08:00
parent 5540773d96
commit 89e53ad1be
5 changed files with 15654 additions and 0 deletions

39
roapi/README.md Normal file
View File

@@ -0,0 +1,39 @@
roapi
=====
[ROAPI][1] automatically spins up read-only APIs for static datasets without
requiring you to write a single line of code.
```bash
$ mkdir -p data
$ curl https://api.spacexdata.com/v4/launches | jq . > data/spacex_launches.json
$ docker compose up -d
```
```bash
$ psql -h 127.0.0.1 -p 5432
kev=> select id, name from spacex_launches limit 10;
id | name
--------------------------+----------------------
5eb87cd9ffd86e000604b32a | FalconSat
5eb87cdaffd86e000604b32b | DemoSat
5eb87cdbffd86e000604b32c | Trailblazer
5eb87cdbffd86e000604b32d | RatSat
5eb87cdcffd86e000604b32e | RazakSat
5eb87cddffd86e000604b32f | Falcon 9 Test Flight
5eb87cdeffd86e000604b330 | COTS 1
5eb87cdfffd86e000604b331 | COTS 2
5eb87ce0ffd86e000604b332 | CRS-1
5eb87ce1ffd86e000604b333 | CRS-2
(10 rows)
kev=> \q
```
```bash
$ curl 127.0.0.1:8080/api/sql -d "SELECT id, name FROM spacex_launches LIMIT 10" | jq -r '.[]|[.id,.name]|@tsv'
$ curl 127.0.0.1:8080/api/kv/spacex_launch_name/600f9a8d8f798e2a4d5f979e
```
[1]: https://github.com/roapi/roapi