분류 전체보기 183

[NODEJS] express, routing

# 개발환경 os : windows 10 Pro 64-bit node-v : v10.16.0 npm-v : 6.9.0 ide : visual Studio Code * 소스 디렉토리 # 소스 디렉토리 [ROOT] ㄴ app.js ㄴ [config] ㄴ dev.js ㄴ prod.js ㄴ [routes] ㄴ router1.js ㄴ router2.js * Express router의 기본형태 const express = require('express'); const router = express(); //기본 형태 router.get('/', function(req, res, next){ });​ : express 서드파티 모듈은 node.js에서 http, connect 컴포넌트를 기반으로 한 웹 프레임워크 ..

LANGUAGE/NODEJS 2019.08.26

[NODEJS] express , 개발, 운영환경 구분 (NODE_ENV)

- 개발환경 # 개발환경 os : windows 10 Pro 64-bit node-v : v10.16.0 npm-v : 6.9.0 ide : visual Studio Code * 목표 : # 개발환경, 운영환경에 따라 설정정보를 다르게 가져오기 위함 express 서드파티 모듈에서는 process.env.NODE_ENV 값에 접근하여 저장된 환경설정 값을 각기 다르게 가져올 수 있음. 개발환경에서는 A.js 파일에서 정보를 가져오고, 운영환경에서는 B.js 파일에서 정보를 가져올 수도 있고, 한 A.js 파일에서 구분자를 다르게 놓고 개발, 운영에서 사용하는 db 정보 등을 구분하여 사용할 수 있음. * 소스 디렉토리 # 소스 디렉토리 [ROOT] ㄴ app.js ㄴ [config] ㄴ dev.js ㄴ ..

LANGUAGE/NODEJS 2019.08.26

[NODEJS] Logger (Winston)

- 개발환경 # 개발환경 os : windows10 Pro 64bit tool : visual studio code npm : v6.9.0 nodejs : v10.16.0 - 목적 : 테스트 및 디버깅, 통계 등의 사용을 위해 로그를 남기기 위함 * 소스 디렉토리 # 소스 디렉토리 [ROOT] ㄴ app.js ㄴ [config] ㄴ dev.js ㄴ prod.js ㄴ logger.js ㄴ [routes] ㄴ router1.js ㄴ router2.js 0. 사전준비 https://bogyum-uncle.tistory.com/71?category=804624 불러오는 중입니다... 1. Logging을 위한 서드파티 모듈 설치 1.1. winston 1.2. winston-daily-rotate-file 1...

LANGUAGE/NODEJS 2019.08.26

[NODEJS] Mysql 연동 1/ 세팅, 스키마 생성

- 개발환경 # 개발환경 os : windows10 Pro 64bit tool : visual studio code npm : v6.9.0 nodejs : v10.16.0 db : mysql 1. 기본 세팅 준비 1.1. 프로젝트 workspace 생성 # C:\nodejs 1.2. app.js 생성 # C:\nodejs\app.js 1.3. npm init package name, version, 등은 다 디폴트로 생성 1.4. mysql 모듈 설치 # visual Studio Code > terminal npm install -S mysql 2. mysql workbench 2.1. 테스트용 스키마 생성 2.2. 테스트용 테이블 생성 2.3. 다음과 같이 작성 혹은 쿼리 실행 -- 테스트용 테이블 생..

LANGUAGE/NODEJS 2019.08.22

[GIT] SourceTree - Github Remote Clone

1. Github > 생성한 Repository 경로 복사 1.1. github 로그인 https://www.github.com Build software better, together GitHub is where people build software. More than 40 million people use GitHub to discover, fork, and contribute to over 100 million projects. github.com 1.2. New Repository - 참고 : 이전에는 Private Repository는 유료였으나 현재는 무료이므로 Public, Private 상관없이 생성하면 됨. 1.3. Clone 주소 복사 2. SourceTree > Remote Clon..

VERSION/GIT 2019.08.21

[GIT] SourceTree 저장소 생성

- 개발환경 # 개발환경 os : windows 10 Pro 64bit sourceTree : SourceTreeSetup-3.1.3 - 목표 : 저장소(Repository) 생성 방법 숙지 1. PC 로컬 내 디렉토리 생성 2. SourceTree > 파일 > Clone/New... 3. Create 탭 > 위에서 만든 디렉토리 설정 4. 디렉토리 생성 중 문제가 생겼다는 알림창이 생길 수 있는데 그냥 예 버튼 선택하면 됨 : 완료되면 다음과 같은 .git 이 생성됨(숨김파일)

VERSION/GIT 2019.08.17

[GIT] SourceTree 설치

- 개발환경 # 개발환경 os : windows 10 Pro 64bit sourceTree : SourceTreeSetup-3.1.3 1. 설치 - 설치 경로 https://www.sourcetreeapp.com/ Sourcetree | Free Git GUI for Mac and Windows A Git GUI that offers a visual representation of your repositories. Sourcetree is a free Git client for Windows and Mac. www.sourcetreeapp.com > Download for Windows 선택 > 실행시키면 다음과 같은 화면이 실행됨 > Sourcetree 를 사용하기 위해선 Bitbucket 계정이 있어..

VERSION/GIT 2019.08.17