Using node.js as a simple web server

后端 未结 30 2086
感情败类
感情败类 2020-11-22 02:54

I want to run a very simple HTTP server. Every GET request to example.com should get index.html served to it but as a regular HTML page (i.e., same

30条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 03:07

    There are already some great solutions for a simple nodejs server. There is a one more solution if you need live-reloading as you made changes to your files.

    npm install lite-server -g
    

    navigate your directory and do

    lite-server
    

    it will open browser for you with live-reloading.

提交回复
热议问题