분류 전체보기
-
[6]#7 BodyParser & PostMan & 회원 가입 기능Node.js/[챕터1] 2021. 4. 29. 01:23
npm install body-parser --save 1) vscode 터미널에서 명령어로 바디파서 다운. 2)postman다운로드 www.postman.com/downloads/ Download Postman | Try Postman for Free Try Postman for free! Join 13 million developers who rely on Postman, the collaboration platform for API development. Create better APIs—faster. www.postman.com postman이란, 프론트단이 구성 되어있지 않기 떄문에 express.js에서 만든 로직을 테스트하기 위함. 3) register router 만들기 const expr..
-
[5]#6 SSH를 이용해 GITHUB 연결Node.js/[챕터1] 2021. 4. 29. 00:32
Gitbash를 킨다음에 ssh -keygen 비밀번호 설정하고나면 인증키 id_rsa 외에 공개키인 id_rsa.pub도 생성되었음을 확인할 수 있습니다. 이 공개키를 깃랩에 등록해야 하는 거죠. 공개키를 확인할 수 있는 방법은 여러 가지가 있겠지만, 저는 해당 경로로 직접 가서 메모장으로 열도록 하겠습니다. /C/Users/사용자명/.ssh/id_rsa.pub 여기에 생성된 퍼블릭키를 github에 가서 이렇게 등록하기. create a new repository는 이전에 했으므로 다음 push and existing을 터미널에 가서 그대로 실행한다. 따라 실행 시키면 뭐 깃 이상한 네모난게 뜨고 허용 하는 부분같은데 허용해주면 터미널에서 업로드해줌.
-
[4]#5 GIT 설치Node.js/[챕터1] 2021. 4. 28. 23:59
git-scm.com/ Git git-scm.com 깃설치하기! 설치후에 터미널에 git --version으로 확인 프로젝트 폴더 디렉토리에서 git init 명령어로 깃 저장소 만들기 git 저장소에 올릴때 "dependencies": { "express": "^4.17.1", "mongoose": "^5.12.6" } 추가되는 라이브러리들 즉 node_modules는 따로 npm으로 설치하기 때문에 올리지 않으므로 .gitignore이라는 파일을 생성 이렇게 추가! 그 이후에 git commit -m "처음 저장소에 올림" 터미널에 이 명령어를 사용하면 로컬 저장소에 저장. 안되누... ui-MacBookPro:tubelife tube.hong$ git config --global user.email..
-
[3]#4 MongoDB Model & SchemaNode.js/[챕터1] 2021. 4. 28. 23:38
폴더 models와 User.js 파일을 만든다 const mongoose = require('mongoose'); const userSchema = mongoose.Schema({ name:{ type: String, maxlength:50 }, email:{ type:String, trim:true, unique:1 }, password:{ type:String, minlength:5 }, lastname:{ type:String, maxlength:50 }, role :{ type:Number, default:0 }, image: { type:String }, token:{ type:String }, tokenExp:{ type:Number } }) const User = mongoose.model..
-
[2]노드 리액트 기초 강의 #3 몽고 DB 연결Node.js/[챕터1] 2021. 4. 28. 23:09
1. 몽고디비 사이트에 회원가입을 한후 로그인하고 Build a Cluster 클릭 프리티어 선택해서 만들고 생성하는데 5~7분 걸린다. 휴식 2. 몽고db 유저생성 CONNECT클릭 username password 입력후 create하기 Create Database User후에 Choose a connection method -> Connect your application -> Add your connection string into your application code 코드를 카피하기! 코드와 db 유저와 비밀번호는 따로 메모해두기. 3. monggoose설치하기 (몽고디비를 유용하게 사용해주게 하는 라이브러리 같은거) npm install mongoose --save 4. express.js 와..
-
[챕터1]NODE JS 와 EXPRESS JS 다운로드Node.js/[챕터1] 2021. 4. 28. 22:33
OS환경 : window 1.노드 다운로드 사이트에서 window환경 노드를 받는다. nodejs.org/en/download/ Download | Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org www.ucert.co.kr/wiki/w/%EC%9C%88%EB%8F%84%EC%9A%B0_node_js_%EC%84%A4%EC%B9%98 윈도우 node js 설치 - Ucert WIKI www.ucert.co.kr 위에 따라 설치 2.나는 C드라이브에 boiler-plate라는 폴더를 만들었다. 이곳에 노드js 프로젝트를 만들계획. npm init 명령어 사용하면 알아서 pakage.json ..
-
import bodyParser from "body-parser";Node.js/express.js 2021. 4. 27. 16:38
express.js 버전 4.16.1 npm install body-parser 이후 const bodyParser = require('body-parser'); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); bodypaser에 줄이 그어져있으면서 'bodyParser' is deprecated.ts(6385) 왜 body-parser가 안되누... medium.com/@mmajdanski/express-body-parser-and-why-may-not-need-it-335803cd048c Express — body-parser and why may not need it Express 4.16+ gets r..
-
express.js에서 라우터 분리하기.Node.js/Node.js공부 2021. 4. 26. 09:45
라우터 - 파일로 분리 github.com/web-n/express/commit/2f70ac08f8f9e7b38ce05ff2ef9a0f81b3c822bf 14.2.라우터 - 파일로 분리 · web-n/express@2f70ac0 Permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Browse files 14.2.라우터 - 파일로 분리 Loading branch information Showing 2 changed files with github.com opentutorials.org/..