[server] Fix static file serving
This commit is contained in:
parent
2b42782842
commit
bd2ad6a11e
1 changed files with 1 additions and 1 deletions
|
@ -15,10 +15,10 @@ func main() {
|
|||
defer a.DB.Close()
|
||||
|
||||
r := mux.NewRouter()
|
||||
r.Handle("/", http.FileServer(http.Dir("./static"))).Methods("GET")
|
||||
r.HandleFunc("/", a.CreateShortURL).Methods("POST")
|
||||
r.HandleFunc("/all", a.ListAll).Methods("GET")
|
||||
r.HandleFunc("/s/{alias:.*}", a.GetURL).Methods("GET")
|
||||
r.PathPrefix("/").Handler(http.FileServer(http.Dir("./static/"))).Methods("GET")
|
||||
http.Handle("/", r)
|
||||
|
||||
log.Println("Server is listening on port 8081")
|
||||
|
|
Loading…
Reference in a new issue