mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 07:56:38 +08:00
fix: embed
This commit is contained in:
parent
f823b4d4d8
commit
21f48b55e0
@ -16,9 +16,9 @@ func SetWebRouter(router *gin.Engine, buildFS embed.FS, indexPage []byte) {
|
||||
router.Use(gzip.Gzip(gzip.DefaultCompression))
|
||||
router.Use(middleware.GlobalWebRateLimit())
|
||||
router.Use(middleware.Cache())
|
||||
router.Use(static.Serve("/", common.EmbedFolder(buildFS, "web/build")))
|
||||
router.Use(static.Serve("/", common.EmbedFolder(buildFS, "web/dist")))
|
||||
router.NoRoute(func(c *gin.Context) {
|
||||
if strings.HasPrefix(c.Request.RequestURI, "/v1") || strings.HasPrefix(c.Request.RequestURI, "/api") {
|
||||
if strings.HasPrefix(c.Request.RequestURI, "/v1") || strings.HasPrefix(c.Request.RequestURI, "/api") || strings.HasPrefix(c.Request.RequestURI, "/assets") {
|
||||
controller.RelayNotFound(c)
|
||||
return
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { defineConfig, transformWithEsbuild } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { splitVendorChunkPlugin } from 'vite'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@ -18,6 +19,7 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
react(),
|
||||
splitVendorChunkPlugin()
|
||||
],
|
||||
optimizeDeps: {
|
||||
force: true,
|
||||
|
Loading…
Reference in New Issue
Block a user