feat: kill server after n downloads

This commit is contained in:
vxclutch
2026-05-29 08:05:00 -04:00
parent 09e147f2f1
commit 230e58c286
7 changed files with 61 additions and 25 deletions

View File

@@ -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)