일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Express
- TypeScript
- typeORM
- nodejs
- flask
- game
- 자료구조
- OCR
- cookie
- Bull
- Sequelize
- 정렬
- AWS
- MySQL
- react
- jest
- MongoDB
- 게임
- mongoose
- class
- 공룡게임
- Python
- Nest.js
- Queue
- nestjs
- dfs
- JavaScript
- GIT
- Dinosaur
- Today
- Total
목록Node.js (111)
포시코딩
https://www.npmjs.com/package/cache-manager cache-manager Cache module for Node.js. Latest version: 5.4.0, last published: 24 days ago. Start using cache-manager in your project by running `npm i cache-manager`. There are 950 other projects in the npm registry using cache-manager. www.npmjs.com https://github.com/nestjs/cache-manager GitHub - nestjs/cache-manager: Cache manager module for Nest f..
Guard import { ExecutionContext, Injectable, UnauthorizedException } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { SamlStrategy } from './saml.strategy'; @Injectable() export class SamlAuthGuard extends AuthGuard('saml') { constructor(private readonly samlStrategy: SamlStrategy) { super(); } canActivate(context: ExecutionContext) { const request = context.switchTo..
import { Injectable } from '@nestjs/common'; import { PassportStrategy, AuthGuard } from '@nestjs/passport'; import { BearerStrategy } from 'passport-azure-ad'; import { AzureUser } from './user'; const clientID = process.env.AAD_CLIENT_ID; const tenantID = process.env.AAD_TENANT_ID; @Injectable() export class AzureADStrategy extends PassportStrategy(BearerStrategy, 'aad') { constructor() { supe..
import * as jwt from 'jsonwebtoken'; jest.mock('jsonwebtoken', () => { return { sign: jest.fn(() => 'TOKEN') }; }); 요렇게 간단히 가능
PartialType() 부모 DTO의 모든 속성을 물려받지만 전부 Optional PickType() 부모 DTO의 속성 중 몇 개만 골라서 물려받음 OmitType() 부모 DTO의 속성 중 몇 개만 제외하고 물려받음 IntersectionType() 두 부모 DTO의 속성들을 모두 물려받음 PartialType(OmitType()) 위와 같이 함께 사용하는 경우 (e.g. UPDATE DTO를 만들 때) export class UpdateUserDto extends PartialType(CreateUserDto) {} 참고 https://velog.io/@yullivan/NestJS-Mapped-Types와-혼란
https://blog.naver.com/pjt3591oo/222978080727 [typeorm] 데이터 저장과 수정을 위한 save, insert, update, upsert 안녕하세요 멍개입니다. 이번 시간은 typeorm에서 제공하는 save(), insert(), update(), upsert()의 동작... blog.naver.com
const updatedUser = await this.orm.createQueryBuilder() .update(User) .set(request.body) .where({id}) .returning("*") .execute() .then(({raw})=>raw[0]);
지금까지는 회원가입 과정에서의 서비스 단에서 비밀번호를 암호화해왔다. 기존 코드 auth.service.ts import * as bcrypt from 'bcrypt'; @Injectable() export class AuthService { async signupBuyer(body: signupBuyerDTO) { const { password } = body; const passwordHash = await this.hashPassword(password); body.passwordHash = passwordHash; // 회원가입 로직 } private async hashPassword(password: string) { return bcrypt.hashSync(password, 10); } } 하..
https://velog.io/@khim89/%EB%B3%B4%EC%9D%BC%EB%9F%AC%ED%94%8C%EB%A0%88%EC%9D%B4%ED%8A%B8-BackEnd1
.getRawMany() 를 사용할 때는 take와 skip이 제대로 동작하지 않는 문제 발견. 대신 limit, offset을 사용하면 잘 작동한다. 이전에 limit, offset 대신 take, skip을 사용하라는 걸 어디서 본 거 같은데 .getMany()를 사용할 때만 정상작동해서 지금껏 해당 오류에 대해 몰랐던 것 같다. https://velog.io/@suyeonpi/Dimelo-Project-take-skip-버그수정-TypeOrm-querybuilder [Dimelo Project] take, skip 버그수정 (TypeOrm querybuilder) 페이지네이션을 구현하기 위해 take, skip을 사용했었다.https://typeorm.biunav.com/en/select-query..