forked from WEB-IB-SS26/development-ib
26 lines
474 B
Go
26 lines
474 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type loginHandler int
|
|
type logoutHandler string
|
|
|
|
func (a loginHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
w.Write([]byte("Login"))
|
|
}
|
|
|
|
func (b logoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
w.Write([]byte("Logout"))
|
|
}
|
|
|
|
func main() {
|
|
var a loginHandler
|
|
var b logoutHandler
|
|
mux := http.NewServeMux()
|
|
mux.Handle("/login", a)
|
|
mux.Handle("/logout", b)
|
|
http.ListenAndServe("localhost:8080", mux)
|
|
}
|