๐Ÿ‘จ‍๐Ÿ’ป kimtongting
article thumbnail
[NestJS] NestJS ์„ค์น˜ํ•˜๊ธฐ(๋‹จ์ˆœ ์„ค์น˜ ๋ฐ ์‹คํ–‰)

NestJS ์„ค์น˜ ์‚ฌ์ „์„ค์น˜ Node.js ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. Node.js ๋งํฌ : nodejs.org/ko/ Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org ๋ณธ์ธ์—๊ฒŒ ๋งž๋Š” ๋ฒ„์ „์„ ์„ค์น˜ํ•˜์„ธ์š” : ) ์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด, ํ„ฐ๋ฏธ๋„ ์ฐฝ์„ ์—ด๊ณ , ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ์ œ๋Œ€๋กœ ์„ค์น˜ํ–ˆ๋Š”์ง€ ํ™•์ธํ•ด๋ด…๋‹ˆ๋‹ค. $ node -v NestJS ์„ค์น˜ Node.js๋ฅผ ์„ค์น˜ํ•˜๊ฒŒ ๋˜๋ฉด ๊ธฐ๋ณธ์ ์œผ๋กœ npm์ด ์ž๋™์œผ๋กœ ์„ค์น˜๋˜๋Š”๋ฐ, npm ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด ์ „์—ญ(-g)์œผ๋กœ nestjs๋ฅผ ์„ค์น˜(i)ํ•ฉ๋‹ˆ๋‹ค. npm i -g @nestjs/cli ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์ ๋‹นํ•œ ํด๋”๋ฅผ ๊ณจ๋ผ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•ด๋ณด๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ์ €๋Š” ์—ฌ๊ธฐ์„œ 'nestPr..

article thumbnail
[Node.js] MyBatis / nodejs ์—์„œ Mybatis ์‚ฌ์šฉํ•˜๊ธฐ / ๋งˆ์ด๋ฐ”ํ‹ฐ์Šค Node.js MyBatis

Node.js ์—์„œ์˜ MyBatis ์ฃผ๋ณ€ ์ง€์ธ๋“ค์—๊ฒŒ NodeJS๋ฅผ ๊ถŒ์œ ํ•˜๋ฉด์„œ ์Šคํ„ฐ๋””๋ฅผ ํ•˜๋‹ค MyBatis์— ๋Œ€ํ•ด ์กฐ์‹ฌ์Šค๋Ÿฝ๊ฒŒ ๋ฌป๊ธธ๋ž˜ ๋‹ต๋ณ€์„ ํ•ด์คฌ๋˜ ๊ธฐ์–ต์ด ์žˆ๋‹ค. Spring Framework ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ Restful API ๋ฅผ ์ž์ฃผ ์‚ฌ์šฉํ–ˆ๋˜ MyBatis, ์ตœ๊ทผ์—๋„ ๊ด€๋ จ ์งˆ๋ฌธ์ด ๋“ค์–ด์™”๊ณ , ๋ถ„๋ช… ๋ˆ„๊ตฐ๊ฐ€๋Š” ๊ถ๊ธˆํ•ด ํ•˜์‹ค ๊ฒƒ์ด๊ธฐ์—! ๊ทธ ๋ถ„๋“ค์„ ์œ„ํ•ด ๊ณต์œ ํ•œ๋‹ค. ์„ค์น˜ $ npm install mybatis-mapper ์„ ์–ธ const mysql = require('postgresql'); //RDBMS const mybatisMapper = require('mybatis-mapper'); //์„ค์น˜ํ•œ Mybatis lib ๋งตํ•‘ //๋ณ„๋„๋กœ ์„ค์ •์„ ๋นผ์ฃผ๋Š”๊ฒŒ ์ข‹์œผ๋‚˜, ์˜ˆ์‹œ๋ฅผ ์œ„ํ•ด ํ•œ ๊ณณ์— ์„ ์–ธ. const connec..