Search code examples
javascriptnode.jsreactjssubdomain

Subdomain setup in react.js


im new to react.js I want to know how can i have multiple subdomains in react Like subdomain.localhost:3000 I tried some tutorials ,when they type subdomain.localhost.com it takes them to default page i.e localhost.com but in my case it is taking me to Invalid host header . Does anyone know how to set multiple subdomains in react.


Solution

  • You can use default host file in OS

    Hosts file is a local file stored on the computer that translates domain names or NetBIOS names into an IP addresses.

    in window you can find in drive:\Windows\System32\drivers\etc

    Problem Solve by adding DANGEROUSLY_DISABLE_HOST_CHECK=true in .env file of React Js