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

Feature: Have a means to configure aemfed, browsersync, etc. #30

Open
chamberlainpi opened this issue Jan 21, 2021 · 1 comment
Open

Comments

@chamberlainpi
Copy link

Either by a file specified via aemfed --config ./aemfed.config.js, or a new entry in package.json (ie: "aemfed": { ... })

I'm currently having issues with some URL requests to Web Fonts returning HTTP 200 with headers containing "connection: close", resulting blank Font files for some reason.

It would be nice to have greater control over the underlying options of aemfed & especially browsersync to inspect the requests / troubleshoot the proxy.

I'm not even sure, but maybe browsersync already looks for such a config if present in the root project directory?

@chamberlainpi
Copy link
Author

chamberlainpi commented Jan 21, 2021

For now I've been using a workaround in Chrome, via an extension called Requestly.

https://chrome.google.com/webstore/detail/requestly-redirect-url-mo/mdnleldcmiljblolnjhpnblkcekpdkpa

And CORS-Unblock:
https://chrome.google.com/webstore/detail/cors-unblock/lfhmikememgdcahcdlaciloancbhjino/

By adding the following rules, I've been able to make the web requests behave like they were served directly from the port :4502 (the actual AEM author instance on my local dev environment)

  1. Modify Headers Rule: Referer, Host, Origin = Match them the same as how your original :4502 requests gets sent. Don't forget to set a "If URL contains..." path that matches only for where your resources are located.

  2. Modify Headers Rule: Replace, With = Set this to whatever you use for your localhost:3000 VS. localhost:4502. Again, don't forget to set a "If URL contains..." path that matches only for where your resources are located.

And that should do it!

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