source 'https://rubygems.org'
gem 'rack'
gem 'puma'
use Rack::Static,
:urls => ["/images", "/js", "/css"],
:root => "public"
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}
Go to the folder
cd static-file-server
puma-dev link
open http://static-file-server.dev
Inspired by puma/puma-dev#87