简体   繁体   English

如何使ADSF / Puma提供没有.html扩展名的HTML文件

[英]How to make ADSF/Puma serve HTML files without the .html extension

I am building a static site without the help of Jekyll or any other known static site builder. 我正在构建一个静态站点,没有Jekyll或任何其他已知静态站点构建器的帮助。 When deploying such site to a static site host like GitHub Pages or Netlify, these servers know to load software.html when I am accessing mydomain.com/software (without the .html extension). 将此类站点部署到静态站点主机(如GitHub Pages或Netlify)时,这些服务器知道在我访问mydomain.com/software (没有.html扩展名)时加载software.html

Is there a way for me to reproduce this behavior when running a local, Ruby-based web server such as Puma? 在运行像Puma这样的本地基于Ruby的Web服务器时,有没有办法让我重现这种行为? More specifically, I am using Ruby's adsf wrapper to launch a Puma server to serve my site locally for development. 更具体地说,我使用Ruby的adsf包装器来启动Puma服务器以在本地为我的站点提供开发。

My guess is that this should be possible by some rack middleware or rack configuration, I am just unable to identify the proper Google search for it. 我的猜测是,这应该是一些机架中间件或机架配置,我只是无法识别正确的谷歌搜索它。

I should probably mention that I am not interested in the directory/index.html approach, since all web servers I have seen add a trailing slash to the URL in these cases. 我应该提一下,我对directory/index.html方法不感兴趣,因为我看到的所有Web服务器都在这些情况下为URL添加了一个尾部斜杠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM