Spaces:
Sleeping
Sleeping
koji
commited on
Commit
·
1bf27ac
1
Parent(s):
a2b1de7
modify readme file
Browse files
README.md
CHANGED
|
@@ -1,56 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
uvicorn main:app --reload
|
| 12 |
-
```
|
| 13 |
-
|
| 14 |
-
### docs
|
| 15 |
-
|
| 16 |
-
```shell
|
| 17 |
-
uvicorn main:app
|
| 18 |
-
```
|
| 19 |
-
|
| 20 |
-
Then go to http://localhost:8000/docs to check the api doc.
|
| 21 |
-
|
| 22 |
-
`/protocol/id` does not work since it is a dummy function right now.
|
| 23 |
-
|
| 24 |
-
## How to run the server with Dockerfile
|
| 25 |
-
|
| 26 |
-
```shell
|
| 27 |
-
git clone https://github.com/koji/api-for-simulator.git
|
| 28 |
-
cd api-for-simulator
|
| 29 |
-
docker build -t simulator-api:1.0.0 .
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
After building the image
|
| 33 |
-
|
| 34 |
-
```shell
|
| 35 |
-
docker run -d --name simulator-api-container -p 80:80 simulator-api:1.0.0
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
Check the container
|
| 39 |
-
|
| 40 |
-
```shell
|
| 41 |
-
docker ps -q -f "name=simulator-api-container" | xargs docker logs -f
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
Test the api server with curl or postman/httpie
|
| 45 |
-
|
| 46 |
-
```shell
|
| 47 |
-
curl localhost:80
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
## Tool
|
| 51 |
-
|
| 52 |
-
- postman: https://www.postman.com/
|
| 53 |
-
- httpie: https://httpie.io/
|
| 54 |
-
|
| 55 |
-
- orbstack https://orbstack.dev/
|
| 56 |
-
A GUI app for Docker which is better than Docker Desktop
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: { { title } }
|
| 3 |
+
emoji: { { emoji } }
|
| 4 |
+
colorFrom: { { colorFrom } }
|
| 5 |
+
colorTo: { { colorTo } }
|
| 6 |
+
sdk: { { sdk } }
|
| 7 |
+
sdk_version: { { sdkVersion } }
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|