Skip to content

Commit 6b8db01

Browse files
author
Alan Christie
committed
feat: Env now has ESS prefix (was WS)
1 parent 836aade commit 6b8db01

File tree

6 files changed

+485
-14
lines changed

6 files changed

+485
-14
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
minimum_pre_commit_version: 4.0.0
2+
minimum_pre_commit_version: 3.8.0
33

44
repos:
55

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ _public_ web-sockets managed by an _internal_ API, managed by the AS using
2424
the required endpoint: -
2525

2626
/event-stream POST
27+
/ event-stream GET
2728
/event-stream/{id} DELETE
2829

2930
See the AS Event Stream API documentation for more details, and the discussion
@@ -65,14 +66,14 @@ request: -
6566

6667
To create (**POST**) an event stream, run the following:
6768

68-
ES_LOC=$(http post localhost:8081/event-stream/ routing_key=0123456789 -b | jq -r ".location")
69-
echo $ES_LOC
70-
ES_ID=$(echo $ES_LOC | cut -d/ -f5)
71-
echo $ES_ID
69+
ESS_LOC=$(http post localhost:8081/event-stream/ routing_key=0123456789 -b | jq -r ".location")
70+
echo $ESS_LOC
71+
ESS_ID=$(echo $ESS_LOC | cut -d/ -f5)
72+
echo $ESS_ID
7273

7374
To **DELETE** the event stream, run the following:
7475

75-
http delete localhost:8081/event-stream/$ES_ID -b
76+
http delete localhost:8081/event-stream/$ESS_ID -b
7677

7778
To list (**GET**) all the existing event streams, run the following:
7879

app/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
app_internal = FastAPI()
3131

3232
# Configuration...
33-
_INGRESS_LOCATION: str = os.getenv("WS_INGRESS_LOCATION", "localhost:8080")
34-
assert _INGRESS_LOCATION, "WS_INGRESS_LOCATION environment variable must be set"
33+
_INGRESS_LOCATION: str = os.getenv("ESS_INGRESS_LOCATION", "localhost:8080")
34+
assert _INGRESS_LOCATION, "ESS_INGRESS_LOCATION environment variable must be set"
3535
_INGRESS_SECURE: bool = os.getenv("WS_INGRESS_SECURE", "no").lower() == "yes"
3636
_LOGGER.info("INGRESS_LOCATION: %s", _INGRESS_LOCATION)
3737
_LOGGER.info("INGRESS_SECURE: %s", _INGRESS_SECURE)
3838

3939
_AMPQ_EXCHANGE: str = "event-streams"
40-
_AMPQ_URL: str = os.getenv("WS_AMPQ_URL", "")
41-
assert _AMPQ_URL, "WS_AMPQ_URL environment variable must be set"
40+
_AMPQ_URL: str = os.getenv("ESS_AMPQ_URL", "")
41+
assert _AMPQ_URL, "ESS_AMPQ_URL environment variable must be set"
4242
_LOGGER.info("AMPQ_URL: %s", _AMPQ_URL)
4343

4444
# Create our local database.

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ services:
2323
image: informaticsmatters/squonk2-fastapi-ws-event-stream:latest
2424
container_name: es
2525
environment:
26-
WS_AMPQ_URL: 'amqp://es:cheddar1963@rabbitmq:5672'
27-
WS_INGRESS_LOCATION: 'localhost:8080'
28-
WS_INGRESS_SECURE: 'no'
26+
ESS_AMPQ_URL: 'amqp://es:cheddar1963@rabbitmq:5672'
27+
ESS_INGRESS_LOCATION: 'localhost:8080'
28+
ESS_INGRESS_SECURE: 'no'
2929
ports:
3030
# Public (Websocket)
3131
- '8080:8080'

0 commit comments

Comments
 (0)