Configuring Automatic Opening of URLs
DevSpace allows you to define URLs that should open after deploying an application in development mode, i.e. using devspace dev
.
The configuration for automatically opening URLs can be found in the dev.open
section of devspace.yaml
.
dev:
open:
- url: http://localhost:3000/login
Setting
dev.open
only affectsdevspace dev
. To open your application after runningdevspace deploy
, rundevspace open
.
dev.open
The open
option expects an array of auto-open configurations with exactly one of the following properties:
url
to open a URL in the default browser
Providing a URL results in the following behavior during
devspace dev
:
- DevSpace deploys the application and starts to periodically send
HTTP GET
requests to the providededurl
.- As soon as the first HTTP response has a status code which is neither 502 (Bad Gateway) nor 503 (Service Unavailable), DevSpace assumes that the application is now started, stops sending any further requests and opens the provided URL in the browser.
open
Default Value For open: []
Example: Open URL when Starting Dev Mode
dev:
open:
- url: http://localhost:3000/login
Explanation:
Running devspace dev
using the above configuration would do the following:
- Build images and deploy the application
- Start port-forwarding and code-synchronization
- DevSpace opens the browser with URL
http://localhost:3000/login