So I’m trying to host some demo WebGL projects using Github Pages. So far I’ve created a project, uploaded index.html alongside the Build and TemplateData folders, and added a web.config file next to index.html with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
<mimeMap fileExtension=".data" mimeType="application/octet-stream" />
<mimeMap fileExtension=".unity3d" mimeType="application/octet-stream" />
<mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".jsgz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".unityweb" mimeType="application/octet-stream" />
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</configuration>
However, on loading the project, I still get this error:
An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Try as I might, I can’t seem to find a way around this. Does anyone here know what is wrong?
I don’t have the money to spend on hosting, so Github Pages is really my only option (I tried Azure, but it has a very tight bandwidth limit that I went over almost immediately), unless anyone knows of any other free web hosts.