Javascript 28

[Node.js] 사용자 비밀번호 암호화, 로그인, 인증(bcryptjs, jsonwebtoken)

bcyptjs는 데이터 암호화 할때 사용 bcryptjs - npm (npmjs.com) bcryptjs Optimized bcrypt in plain JavaScript with zero dependencies. Compatible to 'bcrypt'.. Latest version: 2.4.3, last published: 7 years ago. Start using bcryptjs in your project by running `npm i bcryptjs`. There are 3373 other projects in the npm registry us www.npmjs.com jsonwebtoken는 회원 인증(로그인) jsonwebtoken - npm (npmjs.com) jsonwebtoken..

Javascript/nodejs 2023.12.31

[Node.js] 파일 업로드 (multer, 예제)

Multer는 파일 업로드를 위해 사용되는 multipart/form-data 를 다루기 위한 node.js 의 미들웨어. 참고 multer/doc/README-ko.md at master · expressjs/multer · GitHub upload.js const path = require('path') const multer = require('multer') var storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, 'uploads/') }, filename: function (req, file, cb) { let ext = path.extname(file.originalname) cb(null, Date...

Javascript/nodejs 2023.12.30

Robo 3T(Studio 3T) 설치

1. 설치 Download Studio 3T for MongoDB | Windows, macOS & Linux Download Studio 3T for MongoDB | Windows, macOS & Linux Get started with the most powerful and user-friendly GUI for MongoDB for free. No credit card required. Download now. studio3t.com 압축풀고 실행하면 설치가 완료되고 실행시켜 본다 진행하다보면 로그인하라고 하는데 로그인을 안하면 프로그램이 꺼진다. 로그인을 완료하면 이렇게 나온다. 그 후 connect 누르고 New connection을 누르면 밑에를 선택하고 Next name만 정하고 Test ..

Javascript/nodejs 2023.12.25

MongoDB 설치

1. MongoDB 다운 Download MongoDB Community Server | MongoDB Try MongoDB Community Edition Try MongoDB Community Edition on premise non-relational database including the Community Server and Community Kubernetes Operator for your next big project! www.mongodb.com 체크해제(robo 3T(Studio 3T)를 사용할 예정이기 때문) 2. 환경변수 설정 환경 변수 클릭 path 더블클릭 새로 만들기 클릭 후 C:\Program Files\MongoDB\Server\7.0\bin 추가 2. 데이저 저장 경로 정..

Javascript/nodejs 2023.12.25

Node.js 세팅(express)

1. Node.js 설치 https://nodejs.org/en Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 2.cmd or PowerShall로 버전확인 node -v 3.npm init으로 설정 엔터 누르면됨 entry point 에서 원하는 파일명 쓰기.(미리 만들었으면 자동으로 바뀜, 처음엔 index.js로 되어있음) 3-1 npm init 오류시 file-Preferences-Settings에 들어감 window profile치고 The default teminal profile on Windows. 밑에를 Command Prompt로 바꾸고 vscode 재시작 잘됨 4. e..

Javascript/nodejs 2023.12.23