当前位置:网站首页>项目后台技术Express
项目后台技术Express
2022-08-02 01:55:00 【抹茶生活】
介绍三个方面:
一、Express的安装和使用;
二、Express项目的路由定义;
三、Express项目的静态资源管理;
一、Express的安装和使用
Express应用程序生成器
1.快速创建一个应用框架
npm install express-generator -g

创建好了可以用express -h查看express有哪些常用的命令
2.新建express应用 ,构建了一个不包含模板显示功能的Express服务端应用
express --no-view myapp


3.根据命令提示安装依赖
二、Express提供的路由
Express提供了路由,通过定义路由,可以设计不同的URI地址,可以支持HTTP的各种不同的方法(包括GET、POST和其他请求方式)

在这里遇到一个错误就是发送路由请求无法get
安装Mongodb
npm install mongoose -save
在app.js里面添加如下文件
启动myapp
set DEBUG=myapp * & npm start

边栏推荐
- 秒懂大模型 | 3步搞定AI写摘要
- Basic use of typescript34-class
- When paying attention to the "Internet +" model, you usually only focus on the "Internet +" model itself
- LeetCode brushing diary: 53, the largest sub-array and
- 字节给我狠狠上了一课:危机来的时候你连准备时间都没有...
- 3 Month Tester Readme: 4 Important Skills That Impacted My Career
- PHP直播源码实现简单弹幕效果的相关代码
- 创新项目实战之智能跟随机器人原理与代码实现
- 数据链路层的数据传输
- 电子制造仓储条码管理系统解决方案
猜你喜欢
随机推荐
外包干了三年,废了...
"Introduction to Natural Language Processing Practice" Question Answering Robot Based on Knowledge Graph
三本毕业的我被腾讯拒绝了十四次,最终成功入职阿里
【ORB_SLAM2】void Frame::AssignFeaturesToGrid()
volatile原理解析
第一次写对牛客的编程面试题:输入一个字符串,返回该字符串出现最多的字母
手写一个博客平台~第三天
Fly propeller power space future PIE - Engine Engine build earth science
typescript29-枚举类型的特点和原理
编码经验之谈
CodeTon Round 2 D. Magical Array 规律
当关注「互联网+」模式的时候,通常仅仅只是在关注「互联网+」模式本身
字节给我狠狠上了一课:危机来的时候你连准备时间都没有...
Data transfer at the data link layer
一本适合职场新人的好书
乱七八糟的网站
Day115.尚医通:后台用户管理:用户锁定解锁、详情、认证列表审批
Basic use of typescript34-class
Named parameter implementation of JDBC PreparedStatement
HSDC is related to Independent Spanning Tree









