Question

I'm trying to configure a HotTowel application to work with Apache Cordova/PhoneGap.

I have copied the index.cshtml to index.html and replaced all of the bundle references with html link tags.

The problem is when the page initially loads, it attempts to load App/views/shell.html and fails stating

Cross origin requests are only supported for HTTP

This is happening because I am running index.html over file protocol as required in a Cordova application but I'm not sure how to fix the Cross origin request.

  1. Is there any way to configure Hot Towel/Durandal to work without using HTTP?

  2. Has anyone successfully used Hot Towel with Cordova?

Was it helpful?

Solution

I think that you need to deploy all of your supporting files (like shell.html) to the device as well.

You can also run the durandal optimizer as part of your build process then you only have to deploy main-built.js and your whole app is contained within that one file. Like in this question How to execute the Durandal JS optimizer.exe as part of VS2012 build/publish process?.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top