refactor: added more implementation details
This commit is contained in:
parent
50e6b53091
commit
a1a9c6407f
6 changed files with 86 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ package service
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
|
|
@ -53,7 +54,7 @@ func (s *Service) Serve() error {
|
|||
|
||||
} else {
|
||||
// general
|
||||
router.Get("/download", s.Download())
|
||||
router.Get("/download/*", s.Download())
|
||||
router.Post("/upload", s.Upload())
|
||||
router.Get("/list", s.List())
|
||||
|
||||
|
|
@ -77,7 +78,7 @@ func (s *Service) Serve() error {
|
|||
|
||||
// always available public routes go here
|
||||
router.HandleFunc("/status", s.GetStatus)
|
||||
return nil
|
||||
return http.ListenAndServe(":8080", router)
|
||||
}
|
||||
|
||||
func (s *Service) requireAuth() bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue