Static file server in Golang using gorilla/mux
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have made a app where I need to serve the same files to multiple routes because the front end is a React app. I have been using gorilla mux for the router. The file structure is as follows: main . go build / | index . html | service - worker . js static / | js / | main . js | css / | main . css The files are refereed to assuming they are at the root of the file directory. So in the html file they are requested like '/static/js/main.js'. In main my routes are defined as follows: r . PathPrefix ( "/student" ). Handler ( http .