This helps flip between a page the development server and the same page on the production server.
Link to this page: http://caseywatts.com/flipit
This helps flip between a page the development server and the same page on the production server.
Link to this page: http://caseywatts.com/flipit
| javascript:(function() { | |
| var host = window.location.hostname; | |
| var path = window.location.pathname; | |
| var port = window.location.port; | |
| if (host !== "dashboard.heroku.com") { | |
| window.open("https://dashboard.heroku.com" + path) | |
| } else { | |
| window.open("http://localhost:4200" + path) | |
| } | |
| })(); |
| javascript:(function() { | |
| var host = window.location.hostname; | |
| var path = window.location.pathname; | |
| var port = window.location.port; | |
| var onDashboard = (host === "dashboard.heroku.com" || (host === "localhost" && port === "4200")); | |
| if (onDashboard) { | |
| if (host !== "dashboard.heroku.com") { | |
| window.open("https://dashboard.heroku.com" + path) | |
| } else { | |
| window.open("http://localhost:4200" + path) | |
| } | |
| } else { | |
| if (host !== "elements.heroku.com") { | |
| window.open("https://elements.heroku.com" + path) | |
| } else { | |
| window.open("http://localhost:5000" + path) | |
| } | |
| } | |
| })(); |