index.html的问题

来源:1-1 导学

cpen5

2021-08-17

看不到文件浏览的按钮组件.拉取了git上的代码也看不到.显示http://localhost:8080/static/js/jquery-3.2.1.min.js net::ERR_ABORTED 404 (Not Found)
upload:14 GET http://localhost:8080/static/js/piexif.min.js net::ERR_ABORTED 404 (Not Found)
我的代码和git是一样的

写回答

1回答

xiaomo

2021-08-18

同学你好,你拉取的静态资源文件是参考这里的吗:https://git.imooc.com/coding-323/filestore-server/src/charter2/static

另外,在main.go里需要配置以下静态文件的路径:

func main() {
	// 静态资源处理
	http.Handle("/static/",
		http.StripPrefix("/static/",
			http.FileServer(http.Dir("./static"))))

			// ..
}


0
0

Go实战仿百度云盘-实现企业级分布式云存储系统

紧随“云时代”技术潮流,分布式云存储系统,做第一代云程序员

1077 学习 · 494 问题

查看课程