moved styles css from main to handlers
This commit is contained in:
1
handlers/styles.css
Normal file
1
handlers/styles.css
Normal file
File diff suppressed because one or more lines are too long
23
handlers/styles.go
Normal file
23
handlers/styles.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"embed"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
//go:embed styles.css
|
||||
var cssData embed.FS
|
||||
|
||||
func Styles(c *fiber.Ctx) error {
|
||||
|
||||
cssData, err := cssData.ReadFile("styles.css")
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
|
||||
}
|
||||
|
||||
c.Set("Content-Type", "text/css")
|
||||
|
||||
return c.Send(cssData)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user