node怎么使用html文件

2024-10-19 18:24:41

1、首先在html文件中创建一个p标签。

node怎么使用html文件

2、然后通过http模块的createServer方法和fs模块的readFile方法使用html文件。

node怎么使用html文件

3、运行js文件后,在浏览器的搜索框中输入127.0.0.1:8000。

node怎么使用html文件

4、查看结果。

node怎么使用html文件
猜你喜欢