basic setup
This commit is contained in:
24
main.go
Normal file
24
main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user