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

Default development serverHost #26

Open
andrewreedy opened this issue Jun 22, 2015 · 4 comments
Open

Default development serverHost #26

andrewreedy opened this issue Jun 22, 2015 · 4 comments

Comments

@andrewreedy
Copy link

It would be cool if serverHost defaulted to your IP on the network so that going to 192.168.x.x:1618 on your phone worked. I can get it working by modifying famous-framework.development.bundle.js (Deployer -> options -> codeManagerAssetReadHost), but it feels like that should be default for development so it's easy to test on multiple devices.

@matthewtoast
Copy link
Contributor

👍 This would be a great feature. Would just need to look into the right way to detect this across different systems, and possibly default back to localhost if no found. Plus document how to change it.

@andrewreedy
Copy link
Author

Now that I think about it, the easiest way to do this would just be to use relative paths:

<script type="text/javascript" src="/v1/blocks/andrewreedy:test/versions/HEAD/assets/~bundles/bundle.js"></script>

instead of

<script type="text/javascript" src="http://localhost:1618/v1/blocks/andrewreedy:test/versions/HEAD/assets/~bundles/bundle.js"></script>

@andrewreedy
Copy link
Author

Is the reason for having codeManagerAssetReadHost for possibly using a CDN in production or for loading remote assets? For local components, during development, you could change deployer.js -> codeManagerAssetReadHost to an empty string so that getBundleURL and getAssetURL would return a relative URL and you don't have to worry about getting the IP.

@matthewtoast
Copy link
Contributor

@andrewreedy - That sounds like it could work. You are correct that the reason for codeManagerReadAssetHost is for CDN which we plan to provide for framework users. I will give it a try asap.

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

2 participants