Skip to content

Commit

Permalink
pick url by platform
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Sep 29, 2023
1 parent 4159081 commit fee1596
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.

This file was deleted.

27 changes: 27 additions & 0 deletions x/examples/outline-connectivity-app/app_mobile/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CapacitorConfig } from '@capacitor/cli';

let config: CapacitorConfig = {
appId: "org.outline.sdk.connectivity",
appName: "@outline_sdk_connectivity_demo/app_mobile",
webDir: "output/frontend",
server: {
url: "http://10.0.2.2:3000"
}
}

switch (process.env.CAPACITOR_PLATFORM) {
case "android":
config.server = {
url: "http://10.0.2.2:3000",
cleartext: true
};
break;
case "ios":
default:
config.server = {
url: "http://localhost:3000"
};
break;
}

export default config;
4 changes: 2 additions & 2 deletions x/examples/outline-connectivity-app/app_mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"build:ios": "yarn setup:ios && cap build ios",
"clean": "rm -rf output node_modules ios/capacitor-cordova-ios-plugins ios/App/App.xcarchive ios/App/App.xcodeproj/xcuserdata ios/App/App.xcworkspace/xcuserdata ios/App/Pods ios/App/App/public ios/App/App/capacitor.config.json ios/App/App/config.xml",
"setup": "concurrently 'yarn:setup:*'",
"setup:android": "yarn build:frontend && cap sync android",
"setup:ios": "yarn build:frontend && cap sync ios",
"setup:android": "yarn build:frontend && CAPACITOR_PLATFORM=android cap sync android",
"setup:ios": "yarn build:frontend && CAPACITOR_PLATFORM=ios cap sync ios",
"watch": "concurrently 'yarn:watch:*'",
"watch:android": "yarn setup:android && cap open android",
"watch:frontend": "vite",
Expand Down

0 comments on commit fee1596

Please sign in to comment.