Skip to content

Commit a274fef

Browse files
feat: expose appStartPath on cap config server configuration (#8019)
Co-authored-by: Mark Anderson <mark.anderson@outsystems.com>
1 parent f827c48 commit a274fef

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

android/capacitor/src/main/java/com/getcapacitor/CapConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ private void deserializeConfig(@Nullable Context context) {
251251
serverUrl = JSONUtils.getString(configJSON, "server.url", null);
252252
hostname = JSONUtils.getString(configJSON, "server.hostname", hostname);
253253
errorPath = JSONUtils.getString(configJSON, "server.errorPath", null);
254+
startPath = JSONUtils.getString(configJSON, "server.appStartPath", null);
254255

255256
String configSchema = JSONUtils.getString(configJSON, "server.androidScheme", androidScheme);
256257
if (this.validateScheme(configSchema)) {

cli/src/declarations.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,15 @@ export interface CapacitorConfig {
610610
* @default null
611611
*/
612612
errorPath?: string;
613+
614+
/**
615+
* Append a path to the app URL.
616+
*
617+
* Allows loading from other paths than the default `/index.html`.
618+
* @since 7.3.0
619+
* @default null
620+
*/
621+
appStartPath?: string;
613622
};
614623

615624
cordova?: {

ios/Capacitor/Capacitor/CAPInstanceDescriptor.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ internal extension InstanceDescriptor {
149149
if let initialFocus = (config[keyPath: "ios.initialFocus"] as? Bool) ?? (config[keyPath: "initialFocus"] as? Bool) {
150150
hasInitialFocus = initialFocus
151151
}
152+
if let startPath = (config[keyPath: "server.appStartPath"] as? String) {
153+
appStartPath = startPath
154+
}
152155
}
153156
}
154157
// swiftlint:enable cyclomatic_complexity

0 commit comments

Comments
 (0)