简体   繁体   中英

How can I host my NextJS website on Winhost which supports IISnode?

Recently I developed a website using NextJS with some features like ISR and API Routes. Unfortunately, I purchased a hosting service called Winhost that is not especially for NextJS and only supports IISnode.

So, is there a way I can host my NextJS website without static exporting and retaining all the features?

At the end of the day a NextJS application on the server side is a NodeJS application, follow the steps here

  1. https://support.winhost.com/kb/a1534/node.js.aspx
  2. Make sure you select the right node version with your NextJS application - ie downloading the right node.exe
  3. The mapping file seems to be important so nodejs apps are executed by IISNode
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="iisnode" path="*.js" verb="*" modules="iisnode" />
    </handlers>
  </system.webServer>
</configuration>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM