Open rmetzler opened 13 years ago
I think this is the expected behavior. On a web server this would fail silently too because files in public would be served instead of files from the app. Or am I missing something?
When I go to http://localhost:4000/ serve shows views/index.html.erb
and not public/index.html
After exporting export/index.html
is the same as public/index.html
. It's just a little bit inconsistent and it fails silently.
Good point. :)
I think I can switch this around for Serve. Let me look into it.
There's not an easy way to do this. I'd have to rewrite the Rack directory indexing stuff... Hrmmm...
I didn't test it, but I would expect if you move line 21 of https://github.com/jlong/serve/blob/master/lib/serve/export.rb to the start of the method it should work.
That's true, but I want it to work that way. What I would like to do is get Serve to function the other way so that it mimics the functionality of both export and a normal Ruby deployment.
So the way you want it to work is that serve first renders the .html file, and only processes the template if the .html file doesn't exist?
Right, just like a regular Rack app.
Files in public should be served first, then if those URLs don't exist Serve should check the views directory.
Got it - will see what I can do about that.
I had a Compass project that I converted into a Serve project. This procedure left an
index.html
file inside the public folder.When I start
serve export
it seems like it first renders everything to the target folder and then copies the public folder into target overwriting existing files inside the target folder.I think there are several methods how to deal with this.
I guess there are several other methods more for handling this problem. I would vote for 1 and could provide a patch if needed. Please tell me what you think.