Closed 5nyper closed 8 years ago
This is caused by passing static_routes to App.new. I had removed the static file handling from base app because that should be implemented using Middleware. I haven't yet written middleware for static file handling. I'll do it on the weekend.
You'll need to do it yourself if you need it earlier. Sorry about that (I have a day job).
Basically, you need to make a class that inherits from Moonshine::Middleware::Base. Implement it's process_request method (it's type is Request -> Response?).
You can match the request url with your static dirs. If url doesn't look like "
I've added Moonshine::Utils::StaticDirs middleware class. Call it with a url prefix and some directories to serve the directories at that path
app.middleware_object(Moonshine::Utils::StaticDirs.new("static", ["directory/path"])
here is my code:
and here is the error:
Its been a while since I compiled my server since Crystal was 0.7.1, so I had to fix alot of problem :( Not sure how to deal with this one though.