feat: kill server after n downloads
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func New() http.Handler {
|
||||
func New(ctx *lash.LashContext) http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
fp, err := GetFilePath()
|
||||
@@ -25,9 +25,12 @@ func New() http.Handler {
|
||||
Version: lash.Version,
|
||||
}
|
||||
|
||||
file := handlers.FileData{
|
||||
Contents: contents,
|
||||
FileName: fp,
|
||||
file := handlers.FileHandler{
|
||||
Ctx: ctx,
|
||||
FileData: handlers.FileData{
|
||||
Contents: contents,
|
||||
FileName: fp,
|
||||
},
|
||||
}
|
||||
|
||||
mux.HandleFunc("/", share.Handler)
|
||||
|
||||
Reference in New Issue
Block a user