1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00

added youtube downloader

This commit is contained in:
2017-07-21 00:06:59 -05:00
parent 4baad6b025
commit 43fadf9c6a
14 changed files with 240 additions and 20 deletions

View File

@@ -26,18 +26,21 @@ func getRouter() *chi.Mux {
r.Use(middleware.Logger)
}
r.Get("/soundlist", handlers.SoundList)
r.Put("/upload", handlers.FileUpload)
workDir, _ := os.Getwd()
FileServer(r, "/static", http.Dir(filepath.Join(workDir, "./dist/static")))
FileServer(r, "/sounds", http.Dir(filepath.Join(workDir, "./sounds")))
FileServer(r, "/public/sounds", http.Dir(filepath.Join(workDir, "./sounds")))
FileServer(r, "/public/youtube", http.Dir(filepath.Join(workDir, "./youtube")))
r.NotFound(func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "./dist/index.html")
})
// configure end points
r.Get("/soundlist", handlers.SoundList)
r.Put("/upload", handlers.FileUpload)
r.Get("/ytdownloader", handlers.Downloader)
return r
}