使用 ts 编写 express 服务器的教程
// 安装
yarn install
// 运行
npm run dev
// 编译
npm run build
// 执行编译后的 js 文件
npm run start
打开浏览器输入: http://localhost:3001/?a=10&b=20
- 使用 ts 开发 express 服务器
- 使用 nodemon 自动刷新,必须搭配 ts-node(可以直接运行 ts)
- types 的概念(ts 提示)
- tsc 命令把 ts 编译成 js
- tsconfig 的配置功能点