Skip to content

Commit b08e670

Browse files
author
Alan Christie
committed
docs: Doc tweak
1 parent 6771bd5 commit b08e670

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ Namespace of the AS to service internal requests from the API to create, delete
2020
and connect to the internal messaging bus to stream events to a client.
2121

2222
The implementation is based on Python and the [FastAPI] framework, offering
23-
_public_ web-sockets managed by an _internal_ API, managed by the AS using
24-
the required endpoint: -
23+
_public_ WebSockets managed by an _internal_ API, managed by the AS using
24+
the required endpoints: -
2525

26-
/event-stream POST
27-
/event-stream GET
26+
/event-stream/ POST
27+
/event-stream/ GET
2828
/event-stream/{id} DELETE
2929

3030
See the AS documentation for more details, and the discussion of the [Event Streams]
3131
service on its internal wiki.
3232

33-
The application runs two **uvicorn** FastAPI processes in the container: -
34-
an API listening on port `8081`, and the web-socket service listening on port `8080`.
33+
The application runs two **uvicorn** FastAPI processes in the container.
34+
An API listening on port `8081`, and the WebSocket service listening on port `8080`.
3535

3636
## Contributing
3737
The project uses: -
@@ -111,24 +111,28 @@ to `absent`: -
111111

112112
## Troubleshooting
113113
The deployed application uses the Python logging framework. Significant events
114-
are written to the console, and in a rotating file in `/loga/es.log`.
114+
are written to the console, and in a rotating file in `/logs/es.log`.
115115

116-
Access logging is written to a rotating file handler for `/loga/access.log`,
116+
Access logging is written to the rotating file handler `/logs/access.log`,
117117
and WSGI logging to `/logs/wsgi.log`.
118118

119119
## Local development
120120
You can build and run the service using `docker compose`: -
121121

122122
docker compose up --build --detach
123123

124+
And shut it down with: -
125+
126+
docker compose down
127+
124128
You can interact with it using `http`, where you should be able to create
125129
and delete event streams using the internal API. Here we're using
126130
`jq` and `cut` to process the response body to simplify the subsequent **DELETE**
127131
request: -
128132

129133
To create (**POST**) an event stream, run the following:
130134

131-
ESS_LOC=$(http post localhost:8081/event-stream/ routing_key=0123456789 -b | jq -r ".location")
135+
ESS_LOC=$(http post localhost:8081/event-stream/ routing_key=abc -b | jq -r ".location")
132136
echo $ESS_LOC
133137
ESS_ID=$(echo $ESS_LOC | cut -d/ -f5)
134138
echo $ESS_ID
@@ -152,7 +156,7 @@ read messages from the corresponding web socket: -
152156
If you have a websocket you can start a simple listener with the following command,
153157
which will print each message received: -
154158

155-
./ws_listener.py <location>
159+
./ws_listener.py $ESS_LOC
156160

157161
You can then *inject* a very simple **MerchantCharge** message that will be picked up
158162
by the client using the command: -

0 commit comments

Comments
 (0)