기타2/Nodejs13 cors 1. 에러 Failed to load http://AAAA: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://BBB' is therefore not allowed access. The response had HTTP status code 404.2. 원인현재 도메인과 다른 도메인에서 리소스가 요청될경우 보안상으 이유로 데이터를 받을 수 없다.RESTful API기반으로 통신할때 API서버와 웹서버의 페이지가 달라서 CORS제한이 걸리게된다. 자세한 설명은 요기서 https://developer.mozilla.org/ko/docs/Web/HTTP/Access_control_CORS CORS.. 2018. 8. 9. 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. 이전 1 2 다음