使用node 搭建express
2020-02-13 本文已影响0人
卡卡蘑菇菌

1. 全局安装express
npm install express --save

完成后检测是否安装成功:npm list express

2. 安装express生成程序
cnpm install express-generator -g

3. 创建一个名称为mymedia的Express应用
express --view=pug myapp

此时会在文件夹下看到新创建的对应项目

4. 进入应用编译安装
cd mymedia
npm install

5. 启动应用
set DEBUG=mymedia:* & npm start

在浏览器中输入http://localhost:3000/如下图,成功创建了一个express应用

至此用于后台的express服务端搭建完毕