Mercurial > gemma
changeset 15:05d828374256
Reverted to previous setup of /api prefixing only the token route
At present it seems best only to prefix the token route if we are
planning to serve static files from a web folder
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 21 Jun 2018 09:20:39 +0200 |
parents | afc0de09231f |
children | f912ac27d576 7d242100af46 |
files | cmd/tokenserver/main.go |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/cmd/tokenserver/main.go Wed Jun 20 17:21:32 2018 +0200 +++ b/cmd/tokenserver/main.go Thu Jun 21 09:20:39 2018 +0200 @@ -45,10 +45,8 @@ p, _ := filepath.Abs("./web") mux := http.NewServeMux() mux.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir(p)))) - mux.HandleFunc("/token", token) - api := http.NewServeMux() - api.Handle("/api/", http.StripPrefix("/api", mux)) + mux.HandleFunc("/api/token", token) addr := fmt.Sprintf("%s:%d", *host, *port) - log.Fatalln(http.ListenAndServe(addr, api)) + log.Fatalln(http.ListenAndServe(addr, mux)) }