Skip to content

Commit 7a04fa7

Browse files
committed
web api docs update
1 parent ef023fe commit 7a04fa7

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
> **jsonparse** is a simple JSON parsing library. Extract what's needed from key:value pairs.
1010
11+
## What's New
12+
- New public (or hostable) [web API](#web-api) :tada:
13+
14+
# Python Library
15+
1116
## Install
1217
```bash
1318
pip install jsonparse
@@ -170,30 +175,19 @@ p.find_key_value(data, 'chain', 'B')
170175
[{'chain': 'B', 'rope': 7, 'string': 0.7, 'cable': True}]
171176
```
172177

173-
<!--
174-
# Web API
175-
If you want to use a jsonparse web API, currently you can host it yourself.
176-
177-
## Install + Run
178-
```bash
179-
pip install "jsonparse[webapi]"
180178

181-
gunicorn -b 0.0.0.0:8000 jsonparse.webapi:app
182-
```
179+
# Web API
183180

184-
> Alternatively, run the docker container
181+
## Documentation
185182

186-
```bash
187-
docker run -d ctomkow/jsonparse
188-
```
183+
Visit [the swagger API documentation](https://jsonparse.dev/v1/docs)
189184

190185

191186
## Quickstart
192-
The following quickstart section assumes you are running the web API locally on your machine (127.0.0.1). If the address of where
193-
the web API is hosted is different (e.g. docker container or external server), change the IP accordingly.
187+
Let's practice using the public, free-to-use-no-authentication, web API hosted in GCP Cloud Run.
194188

195189
```bash
196-
curl -X POST "http://127.0.0.1:8000/v1/key/key1" \
190+
curl -X POST "https://jsonparse.dev/v1/key/key1" \
197191
-H 'Content-Type: application/json' \
198192
-d '[{"key0":{"key1":"result","key2":{"key1":"result1","key3":{"key1":"result2"}}}}]'
199193

@@ -217,12 +211,20 @@ data = [{
217211
}
218212
}]
219213

220-
requests.post('http://127.0.0.1:8000/v1/key/key1', json=data).json()
214+
requests.post('https://jsonparse.dev/v1/key/key1', json=data).json()
221215

222216
['result2', 'result1', 'result']
223217
```
224218

225-
## Web API Endpoints
219+
## Self-Hosted
220+
```bash
221+
pip install "jsonparse[webapi]"
226222

227-
Visit https://api.jsonparse.dev to view the swagger API documentation
228-
-->
223+
gunicorn -b 0.0.0.0:8000 jsonparse.webapi:app
224+
```
225+
226+
> Alternatively, run the docker container
227+
228+
```bash
229+
docker run -d ctomkow/jsonparse
230+
```

0 commit comments

Comments
 (0)