hub: Import mux and listen to requests

master
Elis Hirwing 2 years ago
parent f790bda8f4
commit 396f9efbfb
Signed by: etu
GPG Key ID: D57EFA625C9A925F
  1. 2
      .gitignore
  2. 2
      hub/go.mod
  3. 2
      hub/go.sum
  4. 20
      hub/main.go

2
.gitignore vendored

@ -0,0 +1,2 @@
# Ignore eventual build artifacts
hub/main

@ -1,3 +1,5 @@
module git.elis.nu/etu/websubhub/hub
go 1.15
require github.com/gorilla/mux v1.8.0

@ -0,0 +1,2 @@
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=

@ -1,7 +1,23 @@
package main
import "fmt"
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
)
func main() {
fmt.Println("Hello")
router := mux.NewRouter()
router.HandleFunc("/", subscribeHandler).Methods("POST")
log.Fatal(http.ListenAndServe(":8080", router))
}
func subscribeHandler(w http.ResponseWriter, r *http.Request) {
fmt.Println(r)
fmt.Println("got request")
}

Loading…
Cancel
Save