스터디노트
-
JavaScript와 Node.js에 대해서스터디노트/Back-end 2022. 5. 27. 15:08
요새 기업에서 백엔드를 구축할 때 사용하는 기술스택을 보면 Java 말고 Node.js도 굉장히 많은 추세이다. 우리 팀에서도 Node.js를 사용하여 백엔드를 구축하고있다. 단순히 JavaScript라는 언어에 익숙했기 때문에 Node.js가 어떤 것이다 Express가 어떤 것이다라는 것을 학습하면서 Node.js로 백엔드를 구축하고 있었는데 Node.js가 왜 만들어졌고 Node.js를 사용하여 서버를 만들었을 때의 장단점과 어떤 경우에 Node.js를 사용하는게 좋은지 좀 더 근본적인 이유가 궁금했고 JavaScript라는 언어 자체의 근본적인 특징에 대해서도 궁금해졌다. 또한 우리나라 기업 백엔드 기술 스택에서 Java가 90% 이상 차지하고 있다고 생각하는데 많은 기업들이 신규 서버와 기존 서..
-
Joi()로 Validation Check하기스터디노트/Back-end 2022. 5. 25. 14:16
Validation이란?? Client에서 Server에 요청을 보낼 때 정확한 데이터를 보내고 있는지 확인해야한다. 유효성 검사는 Router에서 처리한다. Joi란?? Validation 라이브러리 npm i joi 사용 예 const joiExample = { body: Joi.object().keys({ exampleId: Joi.number().required(), exampleName: Joi.string().required(), exampleArray: Joi.array().items( Joi.object().keys( { exampleObjectId: Joi.number(), } ) ) }), }; 참고자료 https://www.npmjs.com/package/joi
-
express.Router().METHOD스터디노트/Back-end 2022. 5. 11. 09:24
Router란?? 미들웨어 및 라우팅 기능만 수행하는 미니 어플리케이션 express 어플리케이션에는 router 기능이 내장되어있다. 사용방법 : https://expressjs.com/ko/4x/api.html#express.routerconst router = express.Router([options]); router.route() router.router(path) 형태로 사용 가능하다.router.route('/') // root router.route('/auth') // auth router.METHOD(path, [callback, ...] callback) METHOD에는 소문자로 HTTP 메서드를 작성한다. get, post, patch, delete 등등..
-
MongoDB Aggregation스터디노트/DB 2022. 5. 10. 14:54
$arrayElemAt 배열의 특정 인덱스에 있는 값을 리턴한다. yourField의 0번째 인덱스의 값을 리턴 { $arrayElemAt: ['$yourCollection.yourField', 0] } $ifNull 배열의 특정 인덱스에 있는 값을 리턴한다. yourField의 0번째 인덱스의 값이 null인 경우 ' '을 리턴 { $ifNull: [{ $arrayElemAt: ['$yourCollection.yourField', 0] }, ' '] } 참고자료 MongoDB Aggregation : https://www.mongodb.com/docs/manual/reference/operator/aggregation/
-
Graph API를 사용하기 위한 Token 생성스터디노트/클라우드 2022. 5. 3. 13:07
URL https://login.microsoftonline.com/{tenantID}/oauth2/v2.0/token Headers Content-Type : application/x-www-form-urlencoded Body x-www-form-urlencoded grant_type : client_creadentials client_id : Your client_id scope : https://graph.microsoft.com/.default client_secret : Your client_secret 참고자료 https://docs.microsoft.com/en-us/graph/auth-v2-user
-
PowerShell에서 Azure 명령어 사용하기 및 세팅스터디노트/클라우드 2022. 5. 1. 20:01
Windows PowerShell에서 Azure Patrner Center 명령어 사용하기 Install-Module -Name PartnerCenter -AllowClobber -Scope CurrentUser Install-Module -Name PartnerCenter -AllowClobber -Scope AllUsers Partner Center 연결 Connect-PartnerCenter Connect-PartnerCenter -UseDeviceAuthentication Azure Module 설치 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser Install-Module -Name Az -Scope CurrentUser..
-
mongoDB compass에서 간단한 쿼리 날려보기 (Aggregate, $match, $project, $expr, $lookup, ...)스터디노트/DB 2022. 4. 22. 14:42
MongoDB Aggregate pipeline을 가지며 각 단계별로 진행을 마친 후 결과값을 출력한다. $project > $match > $group > $sort > $skip > $limit > $unwind > $out $project : document의 pipeline을 reshape한다. $match : Aggregate에서 필터 역할 $unwind : array form을 삭제하고 flat한 형태로 만들어준다. $match example { $match : { email : 'taeho@xxx.com' } } $project example { $project : { emailLength : {$strLenCP : '$email'}, password : 0 } ..