当前位置:网站首页>1.初步认识express
1.初步认识express
2022-06-13 08:38:00 【cc&】
express---------成为一个懂后端的前端
1. 安装 npm install express
2. 引用
3. 调用
4.监听网站服务器
5. get写方法
// 1.引入express
const express = require('express');
// 2. 调用网站服务器
const app = express();
// 3.get调用
app.get('/', (req, res) => {
res.send('hello express');
});
app.get('/list', (req, res) => {
res.send({ name: 'ss', age: 18 });
});
// 4.监听端口
app.listen(3000);
console.log('网站服务器启动成功');
边栏推荐
- Learning record 4:einops / / cudnn benchamark=true // hook
- About redis encapsulation tool class using distributed locks
- PHP isset() method ignores data error handling caused by null parameter value
- 【Pycharm踩坑记录】配置远程运行后提示,[Errno 2] No such file or directory
- filebeat采集日志到ELK
- How to download and install stm32cubemx
- How about a well-known food material distribution information management system?
- Methods of importing and exporting settings in Altium Designer
- Dest0g3 520迎新赛
- Wechat upload picture material interface
猜你喜欢
Buuctf web (IV)
Format_ String_ Server
Guidance process and service control
MySQL installation and configuration under Windows
HCIP_ MGRE comprehensive experiment
What software can be used to solve the problems faced by the auto parts industry
anaconda下安装pytorch
How about a well-known food material distribution information management system?
JS - for cycle case: Horse grain
How to download and install stm32cubemx
随机推荐
How can the small and medium-sized lighting industry make use of the digital transformation to stand out from the encirclement?
微服务系统架构搭建一:环境搭建
Numeric types in SQL. Try to avoid using null as the default value
Taobao commodity sales interface / Taobao commodity sales monitoring interface / cumulative commodity sales interface
AcWing 1977. Information relay (base ring tree, parallel search set)
Dest0g3 520 orientation
CCNP_ Summary (Continued)
centos 安装mysql及设置远程访问
Sizeof, strlen find character length
情绪处理技巧
How about a well-known food material distribution information management system?
使用kvm创建三台能通局域网的虚拟机
容器概念和云原生
Buuctf web (III)
Disk management and disk partition operation
Penetration problem (main directory, password explosion, database uploading Trojan horse)
In order to resist the flood, the soldiers have been fighting for 89 hours. How many days and hours are there in total?
Input prohibit copy and paste
Undefined and null in JS
VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案