728x90

분류 전체보기 294

할일목록(TODO) 앱 8 - 사용량(트래픽) 제한 구현하기

* 주의할점 : 앞서 virtual 필드 추가한 코드가 반영이 안되어 있을수 있음  토큰을 발급받은 사용자라고 하더라도 API서버에 무리를 줄만큼 과도한 트래픽을 발생하도록 허용하는 것은 좋지 않다. 그렇기 때문에 일정시간동안 API 사용횟수를 제한하여 서버의 트래픽을 제한하는 것이 좋다. 예를 들어 무료로 서비스를 이용하는 사용자는 하루에 50번으로 제한하고 유료 사용자는 하루에 500번으로 제한하는 것이다. npm install express-rate-limit사용량(트래픽) 제한에 대한 구현을 위하여 위 패키지를 설치한다.{ "name": "server", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { ..

할일목록(TODO) 앱 7 - Mongoose virtual 과 moment.js 로 현재 시각 기준으로 시간 표시하기

https://jsikim1.tistory.com/195 moment.js 사용 방법 - JavaScript 날짜 라이브러리moment.js 사용 방법 - JavaScript 날짜 라이브러리 moment.js는 JavaScript에서 사용되는 날짜관련 라이브러리 중 가장 많이 사용되었던 라이브러리입니다. 현재는 더이상의 업데이트가 없을 것이라 하였jsikim1.tistory.comhttps://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose Express Tutorial Part 3: Using a Database (with Mongoose) - Learn web development | MDNIn this articl..

할일목록(TODO) 앱 6 - 데이터 검증하기 (validation)

* Mogoose validate 메서드로 DB 저장 이전에 데이터 형식 검증하기 https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate() Mongoose v8.3.3: SchemaTypeParameters: SchemaType constructor. Do not instantiate SchemaType directly. Mongoose converts your schema paths into SchemaTypes automatically. Example: const schema = new Schema({ name: String }); schema.path('name') instanceof SchemaType; // t..

할일목록(TODO) 앱 5 - chart.js 로 그룹핑한 데이터 그래프로 그리기

https://www.chartjs.org/docs/latest/getting-started/ Getting Started | Chart.jsGetting Started Let's get started with Chart.js! Alternatively, see the example below or check samples. Create a Chart In this example, we create a bar chart for a single dataset and render it on an HTML page. Add this code snippet to your page: You shouldwww.chartjs.orghttps://www.chartjs.org/docs/latest/general/colo..

MongoDB Aggregation 연습을 위한 users, todo 컬렉션 데이터

[{ "_id": { "$oid": "64ce25e477f3990862da1aa1" }, "name": "태양", "email": "sun@gmail.com", "userId": "sunrise", "password": "1234567890", "isAdmin": true, "createdAt": { "$date": "2023-08-05T10:35:16.554Z" }, "lastModifiedAt": { "$date": "2023-08-05T10:35:16.554Z" }, "__v": 0 },{ "_id": { "$oid": "64cf707520b5c16d5cb034f1" }, "name": "홍길동", "email": "gildong@gmail.com", "userId": "gildong", "pass..

데이터베이스 2023.08.09

NODE.JS 공유폴더 경로문제 & Express 기초이론

https://deface.tistory.com/55 [Windows]윈도우에서 명령 프롬프트(CMD) pushd 명령으로 네트워크 드라이브 사용 업무에 필요한 파일을 한곳으로 모으고자 보통의 경우 NAS나 일반 PC의 공유 폴더 기능을 통해 사용하고 계실 겁니다. 일반적인 경우 윈도우의 실행창 과 익스플로러 창에서 \\을 기입하시고 그 deface.tistory.com const express = require('express') // 모듈 임포트 const app = express() const port = 3000 // 서버 포트 // 미들웨어 (middleware) // 미들웨어 중에서 라우트 경로가 포함된 미들웨어 -> 라우트 핸들러 함수 // 라우트 (route) // HTTP 메서드 (GET..

백엔드 2023.08.07

3. 몽고 DB - aggregation (집계, 합산)

https://ozofweird.tistory.com/entry/MongoDB-Aggregation-Pipeline [MongoDB] Aggregation Pipeline 1. Aggregation Pipeline 1) Pipeline 파이프라인이란, 이전 단계의 연산결과를 다음 단계 연산에 이용하는 것을 의미한다. 2) Aggregation Framework MongoDB의 Aggregation Framework는 데이터 처리 파이프라인의 개념을 ozofweird.tistory.com * match 파이프라인 실습 [ { "author" : "dave", "score" : 80, "views" : 100 }, { "author" : "dave", "score" : 85, "views" : 521 }, ..

스크롤바 연습과제

스크롤을 조금 내리면 헤더가 나타나고 scroll to top 버튼도 함께 나타난다. open 버튼을 클릭하면 모달창이 나타나고 뒷배경은 음영처리된다. 또한, 모달창을 확인하는동안 뒷배경이 스크롤되지 않도록 스크롤바는 숨긴다. close 버튼을 클릭하면 모달창이 사라지고 다시 스크롤바가 나타난다. story about contact OPEN header Lorem ipsum, dolor sit amet consectetur adipisicing elit. Corporis officia, tempora ipsam libero expedita, doloribus velit eveniet delectus omnis nostrum consectetur magnam tempore quas explicabo mol..

SASS 입문

https://seokzin.tistory.com/entry/SCSS-SCSS-%EB%AC%B8%EB%B2%95-%EC%A0%95%EB%A6%AC [SCSS] SCSS 문법 정리 프로젝트 규모가 커지고 복잡해질수록 순수 CSS의 한계를 많이 느끼게 됩니다. 그래서 SCSS나 CSS-in-JS의 도입은 사실상 필수가 되었습니다. 이 글을 통해 CSS의 문제점을 개선한 SCSS에 대해 알아보 seokzin.tistory.com 7. 함수 (Function) 박스 1 박스 2 박스 3 $max-width: 100%; // 부트스트랩 그리드 시스템처럼 12개의 컬럼 중에서 특정 비율만큼 가져감 @function columns($number: 1, $columns: 12){ @return $max-width * ..

프론트엔드/CSS 2023.07.17
728x90