Merge branch 'testing'

master
kreativmonkey 7 years ago
commit f6567e0f34

@ -83,7 +83,7 @@ func lookupJSON(w http.ResponseWriter, r *http.Request){
var respond response
if ok := short.GetAPI(queryu, &result); ok {
respond := response{
Action: "shorten",
Action: "lookup",
Result: result,
}

@ -47,9 +47,18 @@ type shrt struct {
func main() {
router := NewRouter()
s := http.StripPrefix("/css/", http.FileServer(http.Dir("./template/css/")))
router.PathPrefix("/css/").Handler(s)
s = http.StripPrefix("/img/", http.FileServer(http.Dir("./template/img/")))
router.PathPrefix("/img/").Handler(s)
/*
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("template/css"))))
http.Handle("/img/", http.StripPrefix("/img/", http.FileServer(http.Dir("template/img"))))
*/
fmt.Printf("Shrt %s started on Port: %s \n", version, port)
http.Handle("/", router)
log.Fatal(http.ListenAndServe(":"+port, router))
}

@ -66,4 +66,5 @@ var routes = Routes{
"/{token}",
redirect,
},
}
Loading…
Cancel
Save