Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony Routes not loaded in BrowserSync server #192

Open
FossPrime opened this issue Aug 11, 2016 · 1 comment
Open

Symfony Routes not loaded in BrowserSync server #192

FossPrime opened this issue Aug 11, 2016 · 1 comment

Comments

@FossPrime
Copy link
Contributor

FossPrime commented Aug 11, 2016

Any idea how to make the LiipImagineFilter symfony component work with grunt serve?

It seems the BrowserSync server needs to load the route...

route details:

+--------------+-----------------------------------------------------------------+
| Route Name   | liip_imagine_filter                                             |
| Path         | /media/cache/resolve/{filter}/{path}                            |
| Path Regex   | #^/media/cache/resolve/(?P<filter>[A-z0-9_\-]*)/(?P<path>.+)$#s |
| Host         | ANY                                                             |
| Host Regex   |                                                                 |
| Scheme       | ANY                                                             |
| Method       | GET                                                             |
| Requirements | filter: [A-z0-9_\-]*                                            |
|              | path: .+                                                        |
| Class        | Symfony\Component\Routing\Route                                 |
| Defaults     | _controller: liip_imagine.controller:filterAction               |
| Options      | compiler_class: Symfony\Component\Routing\RouteCompiler         |
+--------------+-----------------------------------------------------------------+

It seems that when BrowserSync detects a .jpg, it bypasses the router... curious.

@FossPrime
Copy link
Contributor Author

FossPrime commented Aug 11, 2016

To add LiipImagineBundle support just add the route to browsersync.js this should be good enough.

if (!/\.\w{2,}$/.test(obj.pathname)
                            || /\.php/.test(obj.pathname) 
                            || /media\/cache\/resolve/.test(obj.pathname)
                        )

Some requests are routed others are not... by default only php requests are routed. I'll leave this open to see if someone can better convert the ?P<filter> part of its funky route regex.

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

No branches or pull requests

1 participant