加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

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

发布时间:2020-12-14 18:31:23 所属栏目:资源 来源:网络整理
导读: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中间件的用途!每当请求与策

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"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读