Tell air to not watch public, then tell Fiber to not cache public so I can reload it.
This commit is contained in:
parent
63fdc06438
commit
07ff0e6a97
2 changed files with 6 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ tmp_dir = "tmp"
|
||||||
bin = "webapp"
|
bin = "webapp"
|
||||||
cmd = "make build"
|
cmd = "make build"
|
||||||
delay = 1000
|
delay = 1000
|
||||||
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
|
exclude_dir = ["assets", "public", "tmp", "vendor", "testdata"]
|
||||||
exclude_file = []
|
exclude_file = []
|
||||||
exclude_regex = ["_test.go"]
|
exclude_regex = ["_test.go"]
|
||||||
exclude_unchanged = false
|
exclude_unchanged = false
|
||||||
|
|
|
||||||
6
main.go
6
main.go
|
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
|
|
@ -32,7 +33,10 @@ func main() {
|
||||||
api.Setup(app)
|
api.Setup(app)
|
||||||
data.Setup("sqlite3", "db.sqlite3")
|
data.Setup("sqlite3", "db.sqlite3")
|
||||||
|
|
||||||
app.Static("/", "./public")
|
app.Static("/", "./public", fiber.Static{
|
||||||
|
Compress: true,
|
||||||
|
CacheDuration: 1 * time.Nanosecond,
|
||||||
|
})
|
||||||
|
|
||||||
// this sets up graceful shutdown
|
// this sets up graceful shutdown
|
||||||
go func() {
|
go func() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue