Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

hyperloop serving failed asset requests #16

Open
janbiedermann opened this issue Dec 13, 2017 · 0 comments
Open

hyperloop serving failed asset requests #16

janbiedermann opened this issue Dec 13, 2017 · 0 comments

Comments

@janbiedermann
Copy link
Contributor

janbiedermann commented Dec 13, 2017

a asset request that cannot be served by sprockets is passed on to hyperloop and is served, example:

Started GET "/assets/hyperloop_development-550db89dff0309e70f74f20c56c653e8fafb0c7327e80a47118d2172aef87115.js" for 127.0.0.1 at 2017-12-13 13:48:07 +0100
Processing by HyperloopController#AppRouter as JS
  Parameters: {"constrains"=>#<Proc:0x00000114b24c00@/path/to/myapp/config/routes.rb:45 (lambda)>, "all"=>"assets/hyperloop_development-550db89dff0309e70f74f20c56c653e8fafb0c7327e80a47118d2172aef87115"}
  Rendering inline template
************************** React Server Context Initialized AppRouter *********************************************

at the end something is served:

  Rendered inline template (285.9ms)
Completed 200 OK in 296ms (Views: 185.6ms | ActiveRecord: 109.8ms)

Fix: Add constraints to route:

match '*all', to: 'hyperloop#AppRouter', via: [:get], constraints: lambda { |req| !req.path.start_with?('/assets') }

needs to be in the docs, maybe generator

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant