1
0
forked from crony/UpFast

Server future uploaded files.

This commit is contained in:
CronyAkatsuki 2023-12-19 21:01:30 +01:00
parent 912f0049af
commit d68add7803
2 changed files with 15 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
upload
env
.env
files

14
main.go
View File

@ -1,9 +1,12 @@
package main
import (
"errors"
"html/template"
"io"
"log"
"net/http"
"os"
"github.com/labstack/echo/v4"
)
@ -19,6 +22,17 @@ func main() {
e.Static("/", "static")
files := "files"
if _, err := os.Stat(files); errors.Is(err, os.ErrNotExist) {
err := os.Mkdir(files, os.ModePerm)
if err != nil {
log.Println(err)
}
}
e.Static("/files", files)
e.GET("/", Index)
e.Logger.Fatal(e.Start(":1323"))