Using browser-sync with node.js app

后端 未结 4 1731
执念已碎
执念已碎 2021-01-12 11:30

I have an existing node app. My Node directory structure is setup like this:

./
  node_modules/
  src/
    views/
      index.html
      ...
    server.js
           


        
4条回答
  •  不知归路
    2021-01-12 11:41

    Why do you want to use the built-in server if you have your own in ./src/server.js ?

    Check this, What server in browsersync does is create a static server for basic HTML/JS/CSS websites, so you might need to use the proxy feature as shown here. This means that you need to run your server as normally and wrap it up in the proxy.

提交回复
热议问题