linemanjs / lineman-rails

Configures Lineman to deploy assets elegantly with Ruby on Rails
7 stars 1 forks source link

pushState support? #2

Closed jamespeerless closed 10 years ago

jamespeerless commented 10 years ago

Does this work with pushstate? I am getting the following error after setting up both rails-lineman and lineman-rails, starting both servers, and navigating to http://localhost:8000

Error: ENOENT, stat 'generated/index.html'

Full log:

Running "server" task Mounting static assets found in /Users/<fullpath>/generated/js to route /javascripts/lineman Mounting static assets found in /Users/<fullpath>/generated/css to route /stylesheets/lineman Proxying API requests prefixed with 'api' to localhost:3000 Starting express web server in 'generated' on port 8000 Simulating HTML5 pushState: Serving up 'generated/index.html' for all other unmatched paths

Running "watch" task Waiting...

PushState: '/' not found in /Users//generated - Serving up 'generated/index.html' Error: ENOENT, stat 'generated/index.html'

There's no index.html because this plugin removes the pages task. I have moved my old index file into application/index.html.erb in rails.

Any ideas?

jamespeerless commented 10 years ago

Ok well fixed it by disabling pushState through lineman config and added a catchall matcher to my routes.rb. Everything looks good.

searls commented 10 years ago

The gist of it is that you cannot have catch all proxying and catch all push state on a single path pattern. When you do, the server can't know how to handle the request

On Tue, Aug 12, 2014 at 6:58 AM, jamespeerless notifications@github.com wrote:

Closed #2.

Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman-rails/issues/2#event-151806747