sea-team / gofound

GoFound GoLang Full text search go语言全文检索引擎,毫秒级查询。 使用http接口调用,集成Admin管理界面,任何系统都可以使用。
Apache License 2.0
1.59k stars 190 forks source link

web访问admin出现错误:index.3e4347a8.js 返回MIME类型为 “text/plain” #43

Closed brucewang585 closed 2 years ago

brucewang585 commented 2 years ago

详细错误提示: index.3e4347a8.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

添加代码 gofound/web/admin/admin.go: import ( "mime" )

func init() { mime.AddExtensionType(".html", "text/html") mime.AddExtensionType(".css", "text/css") mime.AddExtensionType(".js", "text/javascript") }

newpanjing commented 2 years ago

换linux