You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
320 B
25 lines
320 B
3 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"embed"
|
||
|
"io/fs"
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
//go:embed frontend/dist/*
|
||
|
var FS embed.FS
|
||
|
|
||
|
func main() {
|
||
|
go func() {
|
||
|
gin.SetMode(gin.DebugMode)
|
||
|
router := gin.Default()
|
||
|
|
||
|
staticFiles, _ := fs.Sub(FS, "frontend/dist")
|
||
|
router.StaticFS("/static", http.FS(staticFiles))
|
||
|
|
||
|
}()
|
||
|
|
||
|
}
|