安装 NodeJs Express MVC 框架
新建项目文件夹
打开cmd 执行以下操作:
一、使用Express框架
1)安装express3 $: npm install -g express@3
2)目录下新建工程 $: express -e staticServer
3)安装所需模块 $: cd staticServer && npm install
这部执行完毕即可启动服务器 $: node app
express默认public目录为静态资源目录,可在浏览器中访问http://localhost:3000/images/******对应资源
创建完成后:
1、新建wwwroot文件夹
2、修改根目录下app.js配置

完成以上操作 在 cmd 执行 node app/node app.js

默认端口号为:3000

nodeJs 静态服务器 完成!