25 lines
607 B
Go
25 lines
607 B
Go
package main
|
|
|
|
// https://stackoverflow.com/questions/61080317/go-lang-very-simple-http-post-requests-and-response-endpoint (simple post endpoint)
|
|
// https://stackoverflow.com/questions/16466320/is-there-a-way-to-do-repetitive-tasks-at-intervals
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
_ "github.com/mattn/go-sqlite3"
|
|
)
|
|
|
|
func checkRequestHeader(req *http.Request, res http.ResponseWriter, method string) bool {
|
|
if req.Method == method {
|
|
return true
|
|
}
|
|
res.WriteHeader(http.StatusMethodNotAllowed)
|
|
return false
|
|
}
|
|
|
|
func main() {
|
|
|
|
log.Println("[Main] now serving 0.0.0.0:8090")
|
|
http.ListenAndServe(":8090", nil)
|
|
}
|