Initial structure
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
38
main.go
Normal file
38
main.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user