Typescript를 이용한 Node.js API 서버 프로그래밍

2018. 11. 23. 21:47서버 프로그래밍

최근 진행 중인 프로젝트에서 프론트엔드에 Vue.js와 Typescript를 사용하고 있다. 그래서 기존에 Node.js로 구현한 서버를 Typescript로 변환해보고자 한다.


TypeScript의 소개와 개발 환경 구축

https://poiemaweb.com/typescript-introduction

Getting started with TypeScript and Sublime Text

https://cmatskas.com/getting-started-with-typescript-and-sublime-text/


Node.js에서 Express를 사용하여 REST API 서버를 만들때 Typescript를 사용하는 방법을 친절하게 스텝 바이 스텝으로 정리해놓은 블로그가 있다.

Building RESTful Web APIs with Node.js, Express, MongoDB and TypeScript

https://itnext.io/building-restful-web-apis-with-node-js-express-mongodb-and-typescript-part-1-2-195bdaf129cf

https://github.com/dalenguyen/rest-api-node-typescript


또다른 Node.js에서 Express를 Typescript로 사용하는 예제가 있기는 한데 내 스타일이 아니다.

https://brianflove.com/2016/03/29/typescript-express-node-js/

https://brianflove.com/2016/11/08/typescript-2-express-node/


일부러 Typescript를 사용하는 만큼, 개인적으로 별로 좋아하지 않는 ORM도 같이 써보고자 한다. 

Creating a TypeScript NodeJS Express App using TypeORM and MySQL

http://hive.rinoy.in/creating-a-typescript-nodejs-express-app-using-typeorm-and-mysql-part1/


이런 종류의 ORM에 익숙치 않다보니 사소한 부분에서 계속 막힌다. 

https://github.com/typeorm/typeorm/blob/master/docs/many-to-one-one-to-many-relations.md

http://seogenie2.tistory.com/5

https://github.com/Microsoft/vscode/issues/45071