I'm fairly new to Ruby/Sinatra/Rack. Been using MiddlemanApp for a couple months.
I have a need for a couple of PHP pages in my middleman static site. And I'd like to be able to preview those pages in the browser while running middleman server
. I don't need the PHP file to be parsed or processed, just served up as is in the preview server and with a Content-type of text/html.
In an Apache config, it's easy to tell Apache to treat a given file extension as another type of file. But I don't know where to even start on this in Sinatra/Middleman/Rack.
So:
Can I set Sinatra or Rack to serve up PHP files as static HTML? I don't want or expect Sinatra/Rack to parse the PHP. I just want the PHP embedded/untouched as static HTML when running middleman server
.
I know that I can run middleman build
and use Apache to serve and parse those files, but it's simply tedious to middleman build
every 20 seconds.
EDIT
Ok, so I do realize that the above IS the default behavior. I'll amend my question to this:
- How do I get Sinatra in Middleman App to serve index.php as the index file in the preview server?
Say I have source/test/index.php.erb
and no source/test/index.html.erb
. I'd like middleman server
to serve up the /test/index.php on requests for /test/.