add super basic uptime endpoint to ping

This commit is contained in:
lyx0 2023-12-10 19:08:54 +01:00
parent 05d49e9577
commit 344466a5cc
2 changed files with 15 additions and 0 deletions

View file

@ -4,6 +4,10 @@ import (
"context"
"database/sql"
"fmt"
"html"
"io"
"log"
"net/http"
"os"
"time"
@ -130,6 +134,15 @@ func main() {
"db.Stats", db.Stats(),
)
go func() {
statusHandler := func(w http.ResponseWriter, req *http.Request) {
io.WriteString(w, "up")
}
http.HandleFunc("/status", statusHandler)
sugar.Fatal(http.ListenAndServe(":8080", nil))
}()
// Received a PrivateMessage (normal chat message).
app.TwitchClient.OnPrivateMessage(func(message twitch.PrivateMessage) {
// sugar.Infow("New Twitch PrivateMessage",

View file

@ -14,6 +14,8 @@ services:
context: .
dockerfile: Dockerfile
env_file: .env
ports:
- "127.0.0.1:42069:8080"
depends_on:
- database
volumes: