Create a tunnel from the local development server
(running on config.dev.port) to a publicly accessible URL.
Details
- Reviewers
dereckson - Commits
- rUPSECTION06927826b60b: Adopt local tunnel
Diff Detail
- Repository
- rUPSECTION Upsection
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
components/gulpfile.js | ||
---|---|---|
17–18 | If you require it at line 23, you probably don't need import here. |
components/gulpfile.js | ||
---|---|---|
188 | Why move the location of the server() function? That breaks the Git history. | |
194 | No need to define it if it's false | |
198 | (1) We can put the new code in a setupTunnel() function. See https://jeroendedauw.github.io/slides/craftmanship/functions/#/1 to understand the logic to use short clean functions. (2) In the localtunnel configuration, we should also take the value of tunnel setting to allow the subdomain. (3) We should ensure the code also works when tunnel IS NOT defined in config.yml (no tunnel in that case) (4) The done method should be called AFTER everything is called, including the tunnel, so instead of passing it to browser.init, we can call it afterwards We would then have something like: browser.init(...); if (config.dev.tunnel) { setupTunnel() } done() |
setupTunnel() function defined, allowing the use of a subdomain and code working when the tunnel is not defined