mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add super basic uptime endpoint to ping
This commit is contained in:
parent
05d49e9577
commit
344466a5cc
2 changed files with 15 additions and 0 deletions
|
@ -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",
|
||||
|
|
|
@ -14,6 +14,8 @@ services:
|
|||
context: .
|
||||
dockerfile: Dockerfile
|
||||
env_file: .env
|
||||
ports:
|
||||
- "127.0.0.1:42069:8080"
|
||||
depends_on:
|
||||
- database
|
||||
volumes:
|
||||
|
|
Loading…
Reference in a new issue