当前位置:网站首页>Nestjs入门和环境搭建
Nestjs入门和环境搭建
2022-06-30 05:01:00 【Johnny丶me】
Nest.js 官网
- 官方文档:https://docs.nestjs.com/
- 中文文档:https://docs.nestjs.cn/
- Github:https://github.com/nestjs/nest
Nest.js 是什么
- Nest 是一个渐进的 Node.js 框架,基于TypeScript和JavaScript建高效可伸缩的企业级服务器端应用程序
- 内置TypeScript并结合了OOP,FP和FRP相关理念,设计思想源于Angular和Java
- Nest是Nodejs的的Spring框架,底层HTTP平台默认是基于Express实现的
- 有两个支持开箱即用的HTTP平台:express 和 fastify
- 核心设计思想:提供一个层与层之间耦合度极小抽象化极高的一个设计体系
Nest.js 的特性
- 默认基于Express,也可以基于其他Web HTTP框架
- 默认基于Typescript, 更优秀的面向对象编程体验
- 模块化设计,支持依赖注入
- 支持编写自动化测试程序
- …
Nest.js 快速入门、搭建环境、创建项目
1 ) 环境准备
操作系统:支持 macOS,Linux,Windows
运行环境:Nodejs 建议选择 LTS 版本,建议使用最新版本
2 ) 安装 Nest 脚手架以及使用 CLI 创建项目
我们推荐直接使用脚手架,只需几条简单指令,即可快速生成项目:
- $
cnpm i -g @nestjs/clicli的安装 - $
nest new nest-project基于cli命令生成项目
启动项目:
- $
cnpm run start或 $cnpm run start:dev - $
open http://localhost:3000/
Nest.js 目录结构
nest-project
├── .eslintrc.js eslint配置文件
├── .gitignore git忽略文件
├── .prettierrc prettier 配置文件
├── nest-cli.json cli配置文件
├── package.json 配置文件, 不仅是包依赖配置
├── README.md 描述文档
├── tsconfig.build.json ts配置文件
├── tsconfig.json ts配置文件
├── yarn.lock 版本锁文件
├── dist 构建后的目录
├── test 自动化测试目录
├── src 源码目录
│ ├── app.controller.spec.ts
│ ├── app.controller.ts
│ ├── app.module.ts
│ ├── app.service.ts
│ ├── main.ts
- 可以看到Nest.js的模板目录极简
边栏推荐
- Special folders in unity3d and their meanings
- JS 数组的排序 sort方法详解
- How does unity use mapbox to implement real maps in games?
- Unreal 4 learning notes - data storage using blueprints
- Unity profiler performance analysis
- Detailed explanation of sorting sort method of JS array
- Generate a slice of mesh Foundation
- pycharm 数据库工具
- Force buckle 704 Binary search
- Important knowledge points in unity3d
猜你喜欢

Winter vacation parent-child tour, these new york attractions are not only fun but also knowledge

為什麼win10開熱點後電腦沒有網絡?

Deep learning ----- different methods to realize inception-10

Unreal 4 learning notes - set player birth point

Lambda&Stream

Detailed explanation of the process of "flyingbird" small game (camera adjustment and following part)

Yolov5 torch installation

【Paper】2019_ Consensus Control of Multiple AUVs Recovery System Under Switching Topologies and Time D

Easyrecovery data recovery software recovers my photo and video data two years ago

ParticleSystem in the official Manual of unity_ Collision module
随机推荐
Introduction to some representations, neighbors and degrees of Graphs
力扣349. 两个数组的交集
Output directory of log files after unity3d packaging
[control] multi agent system summary. 5. system consolidation.
National Museum of Singapore - give you spiritual and physical satisfaction
Tcp/ip protocol details Volume I (Reading Guide)
0 basic unity course. Bricklaying
Arrays class
Brew install NVM command not found solution
Important knowledge points in unity3d
svg和canvas的区别
Unreal 4 learning notes - set player birth point
A collection of errors encountered in machine learning with unity
LxC and LXD container summary
Unity realizes rotation and Revolution
Create transfer generation point
How to install win7 on AMD Ruilong CPU A320 series motherboard
【Paper】2015_ Coordinated cruise control for high-speed train movements based on a multi-agent model
Unit screenshot saved on the phone
Oracle-数据的基本操作