분류 전체보기
-
TypeScript 타입스크립트로 Koa 초기 설정하기Today I Learned/NodeJS 2020. 1. 12. 23:48
Koa 'Node.js 웹 프레임워크' 대표적인 Node.js 웹 프레임워크인 Express 개발팀에서 새로 개발한 프레임워크입니다. 많은 메모리를 차지하는 Express 에 비해 가볍고, async/await 문법을 사용하여 편하게 비동기 코드를 작성할 수 있다는 장점이 있습니다. 이번 글에서는 TypeScript 타입스크립트를 이용하는 Koa 서버 초기 환경 설정을 진행해보도록 하겠습니다. 1. 프로젝트 생성하기 2. 모듈 설치하기 3. 타입스크립트 설정파일 생성하기 4. 서버 코드 작성하기 5. script 명령 추가하기 6. 서버 실행하기 참고로 Koa 는 위에서 언급된 async/await 최신 문법을 사용하기 때문에 ES6 문이상을 지원하는 Node.js v7 이상 버전에서 사용되어야 합니다..