@@ -139,54 +139,58 @@ $ busylight --all off # turn all lights off
139
139
First start the ` busylight ` API server using the ` busyserv ` command line interface:
140
140
``` console
141
141
$ busyserve -D
142
- INFO: Started server process [20189 ]
142
+ INFO: Started server process [40064 ]
143
143
INFO: Waiting for application startup.
144
144
INFO: Application startup complete.
145
- INFO: Uvicorn running on http://0.0.0.0:8888 (Press CTRL+C to quit)
145
+ INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
146
+ ...
146
147
```
147
148
148
- The API is fully documented and available @ ` https://localhost:8888/redoc `
149
+ The API is fully documented and available via these URLs:
150
+
151
+ - ` https://localhost:8000/redoc `
152
+ - ` https://localhost:8000/docs `
149
153
150
154
151
155
Now you can use the web API endpoints which return JSON payloads:
152
156
153
157
``` console
154
- $ curl -s http://localhost:8888 /lights/status | jq
158
+ $ curl -s http://localhost:8000 /lights/status | jq
155
159
...
156
- $ curl -s http://localhost:8888 /light/0/status | jq
160
+ $ curl -s http://localhost:8000 /light/0/status | jq
157
161
...
158
- $ curl -s http://localhost:8888 /light/0/on | jq
162
+ $ curl -s http://localhost:8000 /light/0/on | jq
159
163
{
160
164
"light_id": 0,
161
165
"action": "on",
162
166
"color": "green",
163
167
"rgb": [0, 128, 0]
164
168
}
165
- $ curl -s http://localhost:8888 /light/0/off | jq
169
+ $ curl -s http://localhost:8000 /light/0/off | jq
166
170
{
167
171
"light_id": 0,
168
172
"action": "off"
169
173
}
170
- $ curl -s http://localhost:8888 /light/0/on?color=purple | jq
174
+ $ curl -s http://localhost:8000 /light/0/on?color=purple | jq
171
175
{
172
176
"light_id": 0,
173
177
"action": "on",
174
178
"color": "purple",
175
179
"rgb": [128, 0, 128]
176
180
}
177
- $ curl -s http://localhost:8888 /lights/on | jq
181
+ $ curl -s http://localhost:8000 /lights/on | jq
178
182
{
179
183
"light_id": "all",
180
184
"action": "on",
181
185
"color": "green",
182
186
"rgb", [0, 128, 0]
183
187
}
184
- $ curl -s http://localhost:8888 /lights/off | jq
188
+ $ curl -s http://localhost:8000 /lights/off | jq
185
189
{
186
190
"light_id": "all",
187
191
"action": "off"
188
192
}
189
- $ curl -s http://localhost:8888 /lights/rainbow | jq
193
+ $ curl -s http://localhost:8000 /lights/rainbow | jq
190
194
{
191
195
"light_id": "all",
192
196
"action": "effect",
0 commit comments