This project consists of a pair of fastAPI
apis, one that publishes simple
messages to an SNS
topic and one that listens to the topic via HTTP. I did
this to gain familiarity with the subject and perhaps to use the code as
templates or guidance later on.
To start both APIs you can use docker-compose
:
docker-compose up
This will start both services. The publisher listens on port 8000 and the
subscriber listens on 3000. The publisher will publish any messages posted
to it to SNS
. Both services have documentation URL /redoc
.
In order to test locally with SNS
, you must make the subscriber's port
public. You can do this with ngrok:
ngrok http 3000
Remember to add the ngrok URL to the subscriber's .env
file!