当前位置:网站首页>项目后台技术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

边栏推荐
- 《自然语言处理实战入门》 基于知识图谱的问答机器人
- 华为5年女测试工程师离职:多么痛的领悟...
- 垃圾回收器CMS和G1
- 软件测试 接口自动化测试 pytest框架封装 requests库 封装统一请求和多个基础路径处理 接口关联封装 测试用例写在yaml文件中 数据热加载(动态参数) 断言
- Named parameter implementation of JDBC PreparedStatement
- 密码学的基础:X.690和对应的BER CER DER编码
- typescript38-class的构造函数实例方法继承(implement)
- 数据链路层的数据传输
- 大话西游创建角色失败解决
- 【ORB_SLAM2】void Frame::ComputeImageBounds(const cv::Mat &imLeft)
猜你喜欢

Redis Subscription and Redis Stream

Record the pits where an error occurs when an array is converted to a collection, and try to use an array of packaging types for conversion
软件测试功能测试全套常见面试题【开放性思维题】面试总结4-3

typescript30-any类型

typescript35-class的构造函数

Redis 订阅与 Redis Stream

Pcie the inbound and outbound

typescript38-class的构造函数实例方法继承(implement)

2023年起,这些地区软考成绩低于45分也能拿证

【刷题篇】打家劫舍
随机推荐
安全(2)
制造企业数字化转型现状分析
typescript32-ts中的typeof
软件测试功能测试全套常见面试题【开放性思维题】面试总结4-3
『网易实习』周记(一)
LeetCode Review Diary: 34. Find the first and last position of an element in a sorted array
外包干了三年,废了...
『网易实习』周记(二)
About MySQL data insertion (advanced usage)
Redis 底层的数据结构
飞桨开源社区季度报告来啦,你想知道的都在这里
typescript38-class的构造函数实例方法继承(implement)
Some insights from 5 years of automated testing experience: UI automation must overcome these 10 pits
力扣 1374. 生成每种字符都是奇数个的字符串
S/4中究竟有多少个模块,你对这些模块了解多少
Multi-Party Threshold Private Set Intersection with Sublinear Communication-2021: Interpretation
kubernetes之服务发现
Fly propeller power space future PIE - Engine Engine build earth science
Force buckle, 752-open turntable lock
软件测试 接口自动化测试 pytest框架封装 requests库 封装统一请求和多个基础路径处理 接口关联封装 测试用例写在yaml文件中 数据热加载(动态参数) 断言