thisUrl
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Programmatically get the API URLs for the val that calls this val. For example:
// @wilt.myCoolVal:
const myCoolVal = @wilt.thisUrl("web");
}
// returns:
// https://wilt-myCoolVal.web.val.run
If targetVal
is passed as entry
, returns the URL of the very first val in the current call stack. For example:
// @wilt.myFirstCoolVal:
const myFirstCoolVal = @wilt.mySecondCoolVal());
}
// @wilt.mySecondCoolVal:
const mySecondCoolVal = () => {
return @wilt.thisUrl("web", "entry");
}
// Running @wilt.myFirstCoolVal returns:
// https://wilt-myFirstCoolVal.web.val.run