Repository: cordova-plugins Updated Branches: refs/heads/master cba8cf853 -> 85bf5707b
The local web server will load the app under the /app/ path, not the root. This is to facilitate other handlers, and not conflict with names of the pages in the app contents. Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/85bf5707 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/85bf5707 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/85bf5707 Branch: refs/heads/master Commit: 85bf5707bc99703da647f21d801e2490c2b98d7e Parents: cba8cf8 Author: Shazron Abdullah <[email protected]> Authored: Mon Nov 17 13:05:36 2014 -0800 Committer: Shazron Abdullah <[email protected]> Committed: Mon Nov 17 13:05:36 2014 -0800 ---------------------------------------------------------------------- local-webserver/src/ios/CDVLocalWebServer.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/85bf5707/local-webserver/src/ios/CDVLocalWebServer.m ---------------------------------------------------------------------- diff --git a/local-webserver/src/ios/CDVLocalWebServer.m b/local-webserver/src/ios/CDVLocalWebServer.m index ed6490f..15fb665 100644 --- a/local-webserver/src/ios/CDVLocalWebServer.m +++ b/local-webserver/src/ios/CDVLocalWebServer.m @@ -28,6 +28,7 @@ BOOL useLocalWebServer = NO; NSString* indexPage = @"index.html"; + NSString* subPath = @"app"; NSUInteger port = 80; // check the content tag src @@ -55,12 +56,13 @@ self.server = [[GCDWebServer alloc] init]; NSString* path = [self.commandDelegate pathForResource:indexPage]; NSString* authToken = [NSString stringWithFormat:@"cdvToken=%@", [[NSProcessInfo processInfo] globallyUniqueString]]; - [self.server addLocalhostOnlyGETHandlerForBasePath:@"/" directoryPath:[path stringByDeletingLastPathComponent] indexFilename:indexPage cacheAge:0 allowRangeRequests:YES authToken:authToken]; + NSString* appPath = [NSString stringWithFormat:@"/%@/", subPath]; + [self.server addLocalhostOnlyGETHandlerForBasePath:appPath directoryPath:[path stringByDeletingLastPathComponent] indexFilename:indexPage cacheAge:0 allowRangeRequests:YES authToken:authToken]; [self.server startWithPort:port bonjourName:nil]; [GCDWebServer setLogLevel:kGCDWebServerLoggingLevel_Error]; // Update the startPage (supported in cordova-ios 3.7.0, see https://issues.apache.org/jira/browse/CB-7857) - vc.startPage = [NSString stringWithFormat:@"http://localhost:%lu/%@?%@", self.server.port, indexPage, authToken]; + vc.startPage = [NSString stringWithFormat:@"http://localhost:%lu/%@/%@?%@", self.server.port, subPath, indexPage, authToken]; } else { NSLog(@"WARNING: CordovaLocalWebServer: <content> tag src is not http://localhost[:port] (is %@), local web server not started.", vc.startPage); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
