0

What's the simplest way to run a static server without trailing slashes locally? Ideally, I'd simply like to only use tools that come installed with the latest version of OS X.

Unfortunately,

python -m SimpleHTTPServer 8000

and

ruby -run -ehttpd . -p8000

both 301 redirect /about to /about/.

I want the opposite.

See more static server one-liners.

Note: My static site talks to a REST API that uses Rack.

4

1 回答 1

0

除非有人有更好的解决方案,否则使用Rack::Static.

诚然,最新版本的 OS X 并未安装 Rack,但无论如何您都需要它来运行与静态站点通信的 REST API。

请参阅Heroku 开发中心:使用 Rack 在 Ruby 中创建静态站点

请使用您完成的代码更新此答案。谢谢!

于 2015-10-03T04:37:23.870 回答