Using node.js as a simple web server

后端 未结 30 2224
感情败类
感情败类 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:17

    You don't need to use any NPM modules to run a simple server, there's a very tiny library called "NPM Free Server" for Node:

    • NPM Free Server on GitHub

    50 lines of code, outputs if you are requesting a file or a folder and gives it a red or green color if it failed for worked. Less than 1KB in size (minified).

提交回复
热议问题