본문 바로가기

기타2/Nodejs12

mysql2 MYSQL2 https://github.com/sidorares/node-mysql2https://www.npmjs.com/package/mysql2 설치npm install --save mysql2First Query// get the clientconst mysql = require('mysql2'); // create the connection to databaseconst connection = mysql.createConnection({ host: 'localhost', user: 'root',//원본 소스에는 비밀번호부분이 없다password : '000000' database: 'test'}); // simple queryconnection.query( 'SELECT * FROM `table.. 2018. 8. 8.
pm2 PM2http://pm2.keymetrics.io/https://www.npmjs.com/package/pm2 일반전인 웹 애플리케이션을 배포할때는 WAS를 이용한다. 하지만 node의 경우 자체 웹서버의 기능이 존재하여 WAS나 웹서버를 이용할 필요가 없다. node의경우 그냥 node index 의 명령어를 이용하면 애플리케이션이 시작된다. 해당 형태로 시작하게되면 커맨드창을 지속적으로 켜두거나 서버가 뻗어버렸을경우 답이없다. PM2에 나와있는 설명OverviewWhy use PM2 ? At the end of this overview, you will better understand the benefits of using PM2 as a process manager.Forever AlivelinkO.. 2018. 8. 7.
https://jestjs.io/ 모카는 써봤는데 기존 개발자가 테스트툴로 Jest를 사용해놓은걸 봤다.https://jestjs.io/ 일단 보긴 해야될거같은데 모카랑 뭐가 다른지 확인해봐야될거같다. 추가정보 : https://github.com/GoogleChrome/puppeteer 를 통해서 크롤링을 하는 부분이있었는데 디버깅쪽 하는부분이jest와 jasmine,mocha를 추천해준거같은데https://github.com/smooth-code/jest-puppeteer puppeteer에서 디버깅할때 편해서 사용하지 않았나 싶다. 2018. 8. 2.