Skip to content

Commit 561d28b

Browse files
author
Alan Christie
committed
fix: Fix version response
1 parent c31aacd commit 561d28b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,14 @@ And shut it down with: -
125125

126126
docker compose down
127127

128-
You can interact with it using `http`, where you should be able to create
129-
and delete event streams using the internal API. Here we're using
130-
`jq` and `cut` to process the response body to simplify the subsequent **DELETE**
131-
request: -
128+
You can interact with it using `http`, where you should be able to
129+
get the version of the service, create, and delete event streams
130+
using the internal API: -
131+
132+
http localhost:8081/event-stream/version/ -b
133+
134+
Here we're using `jq` and `cut` to process the response body to simplify the
135+
subsequent **DELETE** request: -
132136

133137
To create (**POST**) an event stream, run the following:
134138

app/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,18 @@ async def _get_from_queue(routing_key: str):
229229
# Endpoints for the 'internal' event-stream management API -----------------------------
230230

231231

232-
@app_internal.post("/event-stream/version/", status_code=status.HTTP_200_CREATED)
232+
@app_internal.get("/event-stream/version/", status_code=status.HTTP_200_OK)
233233
def get_es_version() -> EventStreamGetVersionResponse:
234234
"""Returns our version information."""
235235
# And construct the location we'll be listening on...
236-
return EventStreamPostResponse(
236+
return EventStreamGetVersionResponse(
237237
category="WEBSOCKET",
238238
name="Python FastAPI",
239239
version=_VERSION,
240240
)
241241

242242

243-
@app_internal.post("/event-stream/", status_code=status.HTTP_201_OK)
243+
@app_internal.post("/event-stream/", status_code=status.HTTP_201_CREATED)
244244
def post_es(request_body: EventStreamPostRequestBody) -> EventStreamPostResponse:
245245
"""Create a new event-stream returning the endpoint location.
246246

0 commit comments

Comments
 (0)