tripwire/main.go

31 lines
564 B
Go
Raw Normal View History

2022-06-23 00:07:14 +00:00
package main
import (
"log"
"net/http"
"github.com/gorilla/mux"
)
2022-06-23 01:41:55 +00:00
// func notFoundStub(w http.ResponseWriter, r *http.Request) {
// err := YggError{Code: 404, Error: "Not Found", ErrorMessage: "The server has not found anything matching the request URI"}
// sendError(w, err)
// }
2022-06-23 00:07:14 +00:00
func handleRequests() {
r := mux.NewRouter().StrictSlash(true)
registerEndpoints(r)
log.Fatal(http.ListenAndServe(":10000", r))
}
func main() {
2022-06-23 00:47:00 +00:00
log.Println("Tripwire initializing...")
2022-06-23 00:07:14 +00:00
initDB()
2022-06-23 00:47:00 +00:00
log.Println("Tripwire started.")
2022-06-23 00:07:14 +00:00
handleRequests()
defer DB.Close()
}