How to create a simple html server using express js

前端 未结 3 2118
青春惊慌失措
青春惊慌失措 2020-12-30 11:15

I\'m new in node.js I want to create a simple express.js static file server, but I have some issues. I have been installed express.js 4.2 globally like this:



        
3条回答
  •  孤城傲影
    2020-12-30 11:35

    This problem shouldn't even need any code or frameworks; install http-server from npm, navigate to the folder in the command prompt and run this command:

    http-server
    

    And it will spin up a lightweight http server and serve static content up from the folder immediately which can be viewed using http://localhost

提交回复
热议问题