-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
精读 《Nestjs 文档》 #30
Comments
由于临近双十一,太忙了,此次暂时不讨论,待会直接上文章。 |
双十一还早吧。。。 |
你好,在知乎和掘金看到了这篇文章,文章里讲到了 |
是对 “不同实体” 做不同校验,方式是给实体添加装饰器来完成: @Column({
comment: '配置 JSON',
length: 5000,
})
@Validator.IsString({ message: '必须为字符串' })
@Validator.Length(0, 5000, { message: '长度在 0~5000' })
content: string; |
@ascoders 谢谢,如果方便请移步这里:segmentfault,有详细的描述。 我想请教的是,一个实体,定义的时候会声明校验规则(如你上面所写),在请求的时候可以通过 我根据你所写的 |
上传文件FileInterceptor里MulterOptions的storage要怎么创建啊,有没有像multer中的diskStorage,在哪里导入,有人知道吗 |
不是很能理解数据库跑在docker里的操作,不方便持久化处理,而且docker-compose会把项目和数据库混在一起。 |
文档地址:https://docs.nestjs.com/
之所以读它,因为它是一个优雅的类库,基于 express,特别支持 typescript,拥有依赖注入、模块拆分,装饰路由等强大特性,对 async、await 处理也符合我的这篇文章思想: Callback Promise Generator Async-Await 和异常处理的演进。
再配置上 docker-compose,typeorm,一套精美绝伦的强类型 nodejs framework 就建成了,其开发体验丝毫不亚于基于 java 的框架。
The text was updated successfully, but these errors were encountered: