| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- Azure
- 꿀단집
- 개발자취업
- 방송대컴퓨터과학과
- Git
- 파이썬
- 파이썬프로그래밍기초
- 오픈소스기반데이터분석
- 항해99
- nestjs
- 코드잇
- node.js
- 코딩테스트준비
- 중간이들
- 유노코딩
- 99클럽
- mongoDB
- Python
- CSS
- 클라우드컴퓨팅
- 코딩테스트
- 방송대
- 엘리스sw트랙
- HTML
- 데이터베이스시스템
- redis
- JavaScript
- TiL
- aws
- 프로그래머스
- Today
- Total
목록전체 글 (243)
배꼽파지 않도록 잘 개발해요
프로젝트 리팩토링을 하고 있는데, Access token은 리스폰스의 리턴값으로 보내주고, Refresh token은 쿠키에 담아서 전송하기로 하였다. res.cookie를 사용하기 위해 Express의 Response를 importNestJS에서 Request와 Response 객체를 사용하는 방법은 두 가지가 있다. Express로부터 직접 가져온다 NestJS의 @nestjs/common에서 가져온다 VSCode에서 자동 import를 설정해 놓으면 NestJS의 @nestjs/common에서 가져오게 된다. 그런데 쿠키 전송을 위해 res.cookie를 사용하려면 Express의 Response 객체를 사용해야 한다. res를 import하고 res.cookie를 입력했는데 이렇게 인식하지 못하는..
프로젝트에서 클라이언트 Request의 IP 주소를 서버에 저장해야하는 일이 생겼다.그래서 node.js 환경에서는 어떻게 해야하는지 알아보았다. https://stackoverflow.com/questions/8107856/how-to-determine-a-users-ip-address-in-node How to determine a user's IP address in nodeHow can I determine the IP address of a given request from within a controller? For example (in express): app.post('/get/ip/address', function (req, res) { // need access to IP address..
const fs = require('fs');const data = fs.readFileSync('/dev/stdin').toString().trim().split('\n');const [M, N, K] = data[0].split(' ').map(Number);const rectangles = data.slice(1).map(line => line.split(' ').map(Number));function findAreasOfSeparatedRegions(M, N, rectangles) { let grid = Array.from({ length: M }, () => Array(N).fill(0)); rectangles.forEach(([x1, y1, x2, y2]) => { fo..
redisClient에 세션 ID를 넣어주는 코드를 작성하던 중 오류가 발생하였다.NestJS는 기본적으로 TypeScript로 만들어졌기 때문에 타입스크립트를 사용한다. 타입스크립트는 런타임이 아닌 컴파일 중 타입 오류를 발생시킨다. 그래서 코드 작성할 때 시간이 꽤 걸리지만 서버 실행 중 오류가 발생하는 것보다는 백배 낫다.Object literal may only specify known properties, and 'sessionId' does not exist in type 'Buffer'.ts(2353)(property) sessionId: Promise 현상객체를 set 메소드에 직접 전달할 때 타입 에러가 발생하고 있다.문제Object literal이 특정 타입에 맞춰서 작성되어야 하는데..
데이터베이스와의 연결 여부를 알 수 있는 healthcheck API를 만들다가 다음과 같은 오류가 발생하였다. Error: Nest can't resolve dependencies of the HealthCheckService (REDIS_CLIENT, ?). Please make sure that the argument default at index [1] is available in the HealthCheckModule context.Potential solutions:- Is HealthCheckModule a valid NestJS module?- If default is a provider, is it part of the current HealthCheckModule? - If ..
function countSheepGroups(grid, H, W) { const directions = [ [-1, 0], [1, 0], [0, -1], [0, 1] ]; function dfs(x, y) { if (x = H || y = W) return; if (grid[x][y] !== '#') return; grid[x][y] = '.'; for (let [dx, dy] of directions) { dfs(x + dx, y + dy); } } let sheepGroupCount = 0; for (let i = 0; i
/** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val===undefined ? 0 : val) * this.left = (left===undefined ? null : left) * this.right = (right===undefined ? null : right) * } *//** * @param {TreeNode} root * @param {number} distance * @return {number} */var countPairs = function(root, distance) { let result = 0; function dfs(node)..
프로젝트 생성 후 엔드포인트가 'sign-in'인 회원가입 API를 만들어보자. NestJS 프로젝트 생성 명령어npm install -g @nestjs/clinest new project-name 현재 우리 서비스에는 회원가입과 관련된 모듈은 auth 모듈과 users 모듈로, 2개가 있다.auth 모듈은 인증 및 인가와 관련된 기능을 담당하고, users 모듈은 회원 관리와 관련된 기능을 담당한다.먼저 회원 정보를 저장할 Users 엔티티를 생성한다. API 개발은 다음과 같은 순서로 진행될 것이다. 1. Entity 정의2. 의존성 주입 (DI, Dependency Injection)3. DTO 설계4. Service 구현 5. Controller 구현1. Entity 정의우선 'users' 모..