39 lines
495 B
Go
39 lines
495 B
Go
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
|
|
}
|