mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-22 14:13:29 +00:00
📘 add pkger example
This commit is contained in:
parent
ebe107d54f
commit
d0c541ee2b
@ -38,6 +38,29 @@ app.Use(filesystem.New(filesystem.Config{
|
||||
}))
|
||||
```
|
||||
|
||||
## pkger
|
||||
https://github.com/markbates/pkger
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
||||
|
||||
"github.com/markbates/pkger"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := fiber.New()
|
||||
|
||||
app.Use("/assets", filesystem.New(filesystem.Config{
|
||||
Root: pkger.Dir("/assets"),
|
||||
})
|
||||
|
||||
log.Fatal(app.Listen(":3000"))
|
||||
}
|
||||
```
|
||||
|
||||
## packr
|
||||
https://github.com/gobuffalo/packr
|
||||
|
Loading…
x
Reference in New Issue
Block a user