Move to root

This commit is contained in:
Ronnie Roller 2020-02-08 10:39:20 -08:00
parent 2bc0080f55
commit 3b3f384024
4 changed files with 4 additions and 8 deletions

View file

@ -15,10 +15,7 @@ import (
func main() { func main() {
// Setup routes // Setup routes
r := chi.NewRouter() r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) { r.Route("/", func(r chi.Router) {
_, _ = w.Write([]byte("<a href='/media'>media roller</a>"))
})
r.Route("/media", func(r chi.Router) {
r.Get("/", media.Index) r.Get("/", media.Index)
r.Get("/fetch", media.FetchMedia) r.Get("/fetch", media.FetchMedia)
r.Get("/download", media.ServeMedia) r.Get("/download", media.ServeMedia)

View file

@ -216,7 +216,6 @@ func GetMD5Hash(url string) string {
} }
func isValidId(id string) bool { func isValidId(id string) bool {
// TODO: Finish this. Should only be alpha numeric
return idCharSet(id) return idCharSet(id)
} }

View file

@ -18,12 +18,12 @@
<div class="container d-flex flex-column text-light text-center"> <div class="container d-flex flex-column text-light text-center">
<div class="flex-grow-1"></div> <div class="flex-grow-1"></div>
<div class="jumbotron bg-transparent flex-grow-1"> <div class="jumbotron bg-transparent flex-grow-1">
<h1 class="display-4"><a class="text-light" href="/media">media roller</a></h1> <h1 class="display-4"><a class="text-light" href="/">media roller</a></h1>
<p> <p>
Mobile friendly tool for downloading videos from social media Mobile friendly tool for downloading videos from social media
</p> </p>
<div> <div>
<form action="media/fetch" method="GET"> <form action="/fetch" method="GET">
<div class="input-group"> <div class="input-group">
<input name="url" type="url" class="form-control" placeholder="URL" aria-label="URL" <input name="url" type="url" class="form-control" placeholder="URL" aria-label="URL"
aria-describedby="button-submit" autofocus> aria-describedby="button-submit" autofocus>

View file

@ -18,7 +18,7 @@
<div class="container d-flex flex-column text-light text-center"> <div class="container d-flex flex-column text-light text-center">
<div class="flex-grow-1"></div> <div class="flex-grow-1"></div>
<div class="jumbotron bg-transparent flex-grow-1"> <div class="jumbotron bg-transparent flex-grow-1">
<h1 class="display-4"><a class="text-light" href="/media">media roller</a></h1> <h1 class="display-4"><a class="text-light" href="/">media roller</a></h1>
<p> <p>
Mobile friendly tool for downloading videos from social media Mobile friendly tool for downloading videos from social media
</p> </p>