8000 StaticFS embed的路径问题 · Issue #92 · gookit/rux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
StaticFS embed的路径问题 #92
Open
@ismlsmile

Description

@ismlsmile

之前提的一个无法embed的问题,测试了下确实可以。但现在遇到一个embed的路径问题。
假设html的目录是static,目录下有index.html和main.js文件

//go:embed static
var embAssets embed.FS

r.StaticFS("/", http.FS(embAssets))

浏览器访问时需要输入:http://127.0.0.1:8080/static/index.html 但index.html中一般引入js的路径是http://127.0.0.1:8080/main.js 导致无法访问。所以希望在StaticFS中,能够把"static"这一层目录处理掉

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0