first commit

This commit is contained in:
SowinskiBraeden committed 2022-04-10 20:23:23 -07:00
commit be3f79d2e1
14 files changed
+1141

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package main
import (
"html/template"
"github.com/SowinskiBraeden/MyHomeCloud/routes"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/template/html"
)
func main() {
// Create a new engine
engine := html.New("./views", ".html")
engine.AddFunc(
// add unescape function
"unescape", func(s string) template.HTML {
return template.HTML(s)
},
)
app := fiber.New(fiber.Config{
Views: engine,
})
app.Static("/static", "./public")
app.Use(cors.New(cors.Config{
AllowCredentials: true,
}))
routes.Setup(app)
port := "80"
app.Listen(":" + port)
}