Replies: 3 comments
-
Did it by getting the command line parameter with `process.argv'. This is ugly but it works. Better solutions are welcome
|
Beta Was this translation helpful? Give feedback.
-
You can use a node environment variable to set specifics in your config: |
Beta Was this translation helpful? Give feedback.
-
I also found another neat trick using the node command line arguments mentioned here in this post on the Ionic Forum.
Now you can use this inside your config.
Realized this is actually the same as @Schwankenson suggested, but I'll leave it since it seems like this a bit more readable/understandable and bulletproof... |
Beta Was this translation helpful? Give feedback.
-
Hi, we are building our Angular single page app with Capacitor and we are using two different hostnames for the platforms. Is there a way to automate changing them depending on current platform I'm building for? Could I have it setup somewhere else than capacitor.config.json that as far as I know can only have one hostname at a time.
So, I'm using it like this:
Configures for android:
and for iOS:
Is there a better way to do this? I also have the same web app hosted at app.myappname.com and all API calls for the server goes under app.myappname.com/api/*
(this is my first post on this forum, so please guide me if necessary).
Beta Was this translation helpful? Give feedback.
All reactions