38 lines
672 B
Go
38 lines
672 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func readDataStream(resp http.ResponseWriter, request *http.Request) {
|
|
reqBody, _ := io.ReadAll(request.Body)
|
|
|
|
// var jsonBody = json.NewDecoder(request.Body)
|
|
fmt.Println(reqBody)
|
|
}
|
|
|
|
func HealthCheck() {
|
|
|
|
}
|
|
|
|
func handleRequests() {
|
|
// Start new Mux router
|
|
mainrouter := mux.NewRouter().StrictSlash(true)
|
|
|
|
mainrouter.HandleFunc("/", readDataStream).Methods("POST")
|
|
// mainrouter.HandleFunc("/healthcheck", HealthCheck).Methods("GET")
|
|
|
|
log.Fatal(http.ListenAndServe(":10000", mainrouter))
|
|
|
|
}
|
|
|
|
func main() {
|
|
fmt.Println("MPE x Egnyte x PowerApps - Mux Router")
|
|
handleRequests()
|
|
}
|