본문 바로가기

전체 글

(89)
nest.js 연습 <1> - 2 ________________________________________________________________________ Nest.js 에 대해 간단히 알아보자 폴더 : kimminsoo -> NomadCoders -> nest_js -> hi-nest 1. nest.js 는 main.ts 파일을 src 폴더 안에 가진다. 무조건 이 이름이어야 해. 바꾸지 마. —— // src -> main.ts import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); awai..
nest.js 연습 <1> - 1 Nest.js 기초 - API 만들기 폴더 : kimminsoo -> NomadCoders -> nest_js ________________________________________________________________________ Nest.js 셋팅하기 폴더 : kimminsoo -> NomadCoders -> nest_js -> hi-nest 1. 설치 —— npm i -g @nestjs/cli —— 2. nest 프로젝트 만들기 —— nest new —— => kimminsoo -> NomadCoders -> nest_js 이 위치에서 터미널로 “ nest new “ 라고 치면 nest 프로젝트 생성 시작. 바로 다음으로 프로젝트 이름 정해라 하는데, “ hi-nest “ 로 입력했어. 아..
TypeScript 연습 <1> -21- ******************************** 예를 들어서, 다음 같은 경우에는 if 가 필요하겠지 —— type Add2 = { (a:number, b:number) : number (a:number, b:string) : number } const add2 : Add2 = (a, b) => { if (typeof b === "string") { return a } return a + b; } —— => 왜? 매개변수의 타입에 따라서 함수 안에서 구현될 로직이 달라질 테니까. 반대로, 다음 같은 경우에는 if 가 없어도 오류는 발생하지 않아. —— type SuperPrint = { (arr:number..