PostgreSQL simple HTTP service with PRIMARY/REPLICA check for load balancers
What you need?
- Credentials in .pgpass file
- Python3 with psycopg2
HTTP/1.0 200 OK
Server: BaseHTTP/0.6 Python/3.6.8
Date: Fri, 14 Apr 2023 23:34:40 GMT
Content-Type: text/html
PRIMARY%
HTTP/1.0 203 Non-Authoritative Information
Server: BaseHTTP/0.6 Python/3.6.8
Date: Fri, 14 Apr 2023 23:31:05 GMT
Content-Type: text/html
REPLICA%