随笔分类 -  NestJS

摘要:$ npm install qiniu import * as url from 'url'; import * as qiniu from 'qiniu'; @Post('upload') @UseInterceptors(FileInterceptor('file')) async upload 阅读全文
posted @ 2021-01-09 13:48 Ajanuw 阅读(546) 评论(0) 推荐(0)
摘要:nestjs 文档 mongoose 文档 使用"@meanie/mongoose-to-json"转换查询后返回的json数据 将"_id"转为"id",并删除"__v"字段 import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose 阅读全文
posted @ 2021-01-07 13:06 Ajanuw 阅读(724) 评论(0) 推荐(0)
摘要:1. 在宝塔上下载pm2 2. 打包你的服务端代码 "npm run build && cp ./package.json ./dist/" 3. 在宝塔文件"/www/wwwroot/"下创建一个文件,将打包的服务器代码放进去 4. 打开pm2管理器,添加你的项目 注: 启动时,会自动执行"npm 阅读全文
posted @ 2021-01-05 19:43 Ajanuw 阅读(2191) 评论(0) 推荐(0)
摘要:"文档" 只是用https import as fs from 'fs'; import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; const httpsOptions = { key 阅读全文
posted @ 2020-04-09 10:24 Ajanuw 阅读(2297) 评论(0) 推荐(0)
摘要:route dto 阅读全文
posted @ 2019-08-15 21:32 Ajanuw 阅读(1541) 评论(0) 推荐(0)
摘要:bcrypt install λ npm i bcrypt λ npm i --save-dev @types/bcrypt example import * as bcrypt from 'bcrypt'; const db = {} (async () => { const myPlaintex 阅读全文
posted @ 2019-08-11 11:52 Ajanuw 阅读(2070) 评论(0) 推荐(1)
摘要:$ cd <project-root-path> 进入项目根目录 $ npm run build $ pm2 start npm --name <name> -- run start:prod pm2基本命令 $ npm install pm2 -g # 命令行安装 pm2 $ pm2 start 阅读全文
posted @ 2018-11-12 22:34 Ajanuw
摘要:"文档" 阅读全文
posted @ 2018-10-24 22:20 Ajanuw 阅读(1613) 评论(0) 推荐(0)
摘要:"文档" let r = await this.http.get( ).toPromise().then(v = v.data); l(r); ``` 阅读全文
posted @ 2018-10-20 15:51 Ajanuw 阅读(2038) 评论(0) 推荐(0)
摘要:cookie-parser Docs npm i cookie-parser main.ts import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import * as cooki 阅读全文
posted @ 2018-10-09 21:11 Ajanuw 阅读(1663) 评论(0) 推荐(0)
摘要:Docs: "https://docs.nestjs.com/websockets/gateways" λ yarn add @nestjs/websockets λ nest g ga events events.gateway.js app.module.ts 客户端 监听进入与离开 impor 阅读全文
posted @ 2018-10-01 13:01 Ajanuw 阅读(3676) 评论(0) 推荐(2)
摘要:官网文档 $ npm i -D @types/multer 上传单文件 import { Post, UseInterceptors, UploadedFile } from '@nestjs/common'; import { FileInterceptor } from '@nestjs/pla 阅读全文
posted @ 2018-09-02 20:55 Ajanuw 阅读(4760) 评论(0) 推荐(1)
摘要:"Docs: https://docs.nestjs.com/techniques/mvc" 新版本需要设置为NestExpressApplication main.js 加载静态页面 yarn add ejs sendFile 阅读全文
posted @ 2018-09-02 17:35 Ajanuw 阅读(5157) 评论(0) 推荐(1)