Initial structure

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
2025-05-02 13:22:49 +01:00
parent 71fccf0ddf
commit 866cbaa42f
6 changed files with 66 additions and 28 deletions

38
main.go Normal file
View File

@@ -0,0 +1,38 @@
package main
import (
"fmt"
"net/http"
"os"
"github.com/joho/godotenv"
)
var (
port string
)
func init() {
godotenv.Load(os.Getenv("DOTENV_DIR") + ".env")
var ok bool
port, ok = os.LookupEnv("PORT")
if !ok {
port = "8000"
}
}
func main() {
go updateWorker()
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
})
http.ListenAndServe(fmt.Sprintf(":%s", port), nil)
}
func updateWorker() {
// TODO: Update worker
}