Reputation: 15794
I'd my webapp to available at:
http://example.com/ui/ # My flutter web application
http://example.com/api/... # REST endpoints
How can I find the URL from which my app was downloaded (http://example.com/ui/
), so that can produce the URL http://example.com/api/
from it?
I'd prefer to not bake the example.com
into the webapp because we deploy to a number of clusters with difference domain names during CI.
Upvotes: 2
Views: 1621
Reputation: 82
import 'dart:html' as html;
...
debugPrint('host=${html.window.location.host + html.window.location.pathname}');
...
Upvotes: 5