Configuration of running threejs in IIS

1 First install IIS correctly

2 Add the following content in the web.config file of the project

<system.webServer>
    <defaultDocument>
      <files>
        <add value="default.aspx" />
      </files>
    </defaultDocument>
    <httpProtocol>


      <customHeaders>
        <!-- CORS temporary solution -->
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="--allow-file-access-from-files" value="*" />
        <add name="Access-Control-Allow-Headers" value="Content-Type, Authorization, Accept, X-Requested-With" />
        <add name="Access-Control-Allow-Methods" value="OPTIONS, TRACE, GET, HEAD, POST, PUT" />
      </customHeaders>


    </httpProtocol>

  </system.webServer>

3 Add MIME

Add any model file that needs to be used. I originally wanted to add stl, but the system has already been added.

The last step is to restart IIS. Basically it is OK, of course, the THREEJS related files must be placed in the correct location.

 

Guess you like

Origin blog.csdn.net/sichuanpb/article/details/111593140