added build script
This commit is contained in:
@@ -4,3 +4,4 @@ test-db.sqlite*
|
||||
*_templ.go
|
||||
node_modules/
|
||||
styles.css
|
||||
mmaschedule
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
main() {
|
||||
cd src/ || return
|
||||
bun run build
|
||||
templ generate
|
||||
go build -o mmaschedule
|
||||
}
|
||||
|
||||
main
|
||||
+3
-6
@@ -11,8 +11,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//go:generate bun run build
|
||||
//go:generate templ generate
|
||||
//go:embed static/*
|
||||
var staticfiles embed.FS
|
||||
|
||||
func RunServer(addr string, queries *event.Queries) error {
|
||||
mux := http.NewServeMux()
|
||||
@@ -28,11 +28,8 @@ func RunServer(addr string, queries *event.Queries) error {
|
||||
return err
|
||||
}
|
||||
|
||||
//go:embed static/*
|
||||
var staticFiles embed.FS
|
||||
|
||||
func StaticHandler(prefix string) (http.Handler, error) {
|
||||
static, err := fs.Sub(staticFiles, "static")
|
||||
static, err := fs.Sub(staticfiles, "static")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user