haskell – Web Scotty:提供静态文件时找不到文件


504 Gateway Time-out

504 Gateway Time-out

Nginx/1.12.2


解决方法

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’.

但这正是070​​00中间件的用途!每当请求与策略匹配时(在本例中为./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"

相关文章

vue阻止冒泡事件 阻止点击事件的执行 <div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些