解决方法
If I type ‘/index.html’ at the browser – it works. But it is wrong! I want it to be accessible via ‘/’ but not ‘/index.html’.
但这正是07000中间件的用途!每当请求与策略匹配时(在本例中为./static/中的文件),它将被staticPolicy过滤.如果您不想要这种行为,请删除中间件.
Accessing via ‘/’ in the browser gives me the ‘file not found’ thing.
因为middlware操作未设置以下命令的相对路径.您需要提供file
的完整路径:
main = scotty 3000 $do get "/" $file "./static/index.html"