当前位置:网站首页>Nodejs教程之让我们用 typescript 创建你的第一个 expressjs 应用程序
Nodejs教程之让我们用 typescript 创建你的第一个 expressjs 应用程序
2022-07-06 12:51:00 【知识大胖】
Express.js 是什么
Express.js,或简称 Express,是 Node.js 的后端应用程序框架,在 MIT 许可下作为免费和开源软件发布。它专为构建 Web 应用程序和 API 而设计。它被称为 Node.js 的事实上的标准服务器框架。
核心库
- express — 这是我们将用于构建 api 的 Node.js 模块
- body-parser — Node.js 正文解析中间件
- cors — 这是 node.js 包,用于提供Connect / Express中间件,可用于启用具有各种选项的CORS 。
- helmet — helmet 是一个 Node.js 包,它通过设置各种 http 标头来帮助您保护您的快速应用程序
- morgan — morgan 是一个 Node.js 包,它可以帮助我们知道谁在向我们的 express 应用程序请求 api
- nodemon — nodemon 是一个工具,通过在检测到目录中的文件更改时自动重新启动节点应用程序来帮助开发基于 node.js 的应用程序。
- ts-node — ts-node 是一个 TypeScript 执行引擎和 Node.js 的 REPL。
- typescript
- @types/express、@types/body-parser、@types/cors、@types/helmet、@types/morgan、- @types/node——这个包包含类型定义
安装环境
好的,让我们从安装所有必需的包开始
npm install express body-parser cors helmet morgan
边栏推荐
- SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
- 爱可可AI前沿推介(7.6)
- Data Lake (VIII): Iceberg data storage format
- KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐
- 全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
- ICML 2022 | flowformer: task generic linear complexity transformer
- Select data Column subset in table R [duplicate] - select subset of columns in data table R [duplicate]
- Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)
- Web开发小妙招:巧用ThreadLocal规避层层传值
- Study notes of grain Mall - phase I: Project Introduction
猜你喜欢
3D人脸重建:从基础知识到识别/重建方法!
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
What key progress has been made in deep learning in 2021?
全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
Study notes of grain Mall - phase I: Project Introduction
监控界的最强王者,没有之一!
Application layer of tcp/ip protocol cluster
[asp.net core] set the format of Web API response data -- formatfilter feature
2017 8th Blue Bridge Cup group a provincial tournament
1500萬員工輕松管理,雲原生數據庫GaussDB讓HR辦公更高效
随机推荐
ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
966 minimum path sum
性能测试过程和计划
Opencv learning example code 3.2.3 image binarization
【微信小程序】運行機制和更新機制
c#使用oracle存储过程获取结果集实例
R語言可視化兩個以上的分類(類別)變量之間的關系、使用vcd包中的Mosaic函數創建馬賽克圖( Mosaic plots)、分別可視化兩個、三個、四個分類變量的關系的馬賽克圖
use. Net analysis Net talent challenge participation
Aike AI frontier promotion (7.6)
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
What are RDB and AOF
Is it safe to open an account in flush? Which securities company is good at opening an account? Low handling charges
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
[DIY]如何制作一款個性的收音機
js中,字符串和数组互转(一)——字符串转为数组的方法
R language visualizes the relationship between more than two classification (category) variables, uses mosaic function in VCD package to create mosaic plots, and visualizes the relationship between tw
OSPF multi zone configuration
3D人脸重建:从基础知识到识别/重建方法!
[200 opencv routines] 220 Mosaic the image
PHP online examination system version 4.0 source code computer + mobile terminal