본문 바로가기

전체 글

(68)
body-parser[Middleware] body-parser: Parse incoming request bodies in a middleware before your handlers, available under the req.body property. when you use body-parser, you need to put any options. if you dont, you will get a sentence like "body-parser deprecated undefined extended: provide extended option" so we usually put ".urlencoded({ extended: true or false })" this means if "extended : true", this means req.bod..
How to test passport-facebook /Social login test [TDD] How to do test passport social login? Facebook delegates login instead of me. I just needed to set passport stuffs in my application code. If I set passport code in my app, and If I send request 'login', Facebook does work. like redirecting to login page, validating Id/Password input, and showing result page etc. these processes is not in my application code. so I didn't know what to do for test..
지우씨 오늘 문득 정지우 작가가 내게 정말 큰 존재가 되어버렸다는 생각이 들었다. 평소 거추장스럽지만 가방을 들고 다니는 이유는 그의 책을 읽고 싶을때마다 읽고 싶어서다. 매일 가지고 다닌다고 매일 읽지는 않지만 마음이 혼란스러워졌다 싶으면 그의 책을 꺼내서 읽는다. 그러다보면 어느새 내 중심으로 조금이나마 돌아온다. 내 가치관과 그의 가치관이 닮은 점이 많은 것인지, 그의 책을 읽다보니 내 가치관이 그의 가치관을 닮게 된 것인지 불확실하다만은. 내가 옳다고 믿는것을 그도 옳다고 믿는다는 생각이 든다. 그리고 그런 믿음을 가지고 그는 나보다 좀더 긴시간 살아왔고 내가 이루고 싶은 길, 해나갈 길을 그는 어느정도 이뤄냈다. 그의 삶은 내게, 나 또한 이뤄낼 수 있을 것이라는 희망을 준다. "누군가에게 진실이었던 ..
2st week June 8 june 2020 I don't like frontend, but I need to. So~ just do that. with what? - Vue docs "https://vuejs.org/v2/guide/" - Vuetify by "The net ninja" "https://www.youtube.com/watch?v=2uZYKcKHgU0&list=PL4cUxeGkcC9g0MQZfHwKcuB0Yswgb3gA5" - 개린이르라나 "https://www.youtube.com/watch?v=s1lXVr65KZg&list=PLyjjOwsFAe8ITIDUNsU_x4XNbPJeOvs-b" Everyday An Hour Algorithm Study -
Course CRUD [TDD, express] Course ModelSchema const mongoose = require('mongoose'); const slugify = require('slugify'); const CourseSchema = new mongoose.Schema( { name: { type: String, required: [true, 'Please add a name'], unique: true, trim: true, maxlength: [50, 'Name can not be more than 50 characters'] }, slug: String, description: { type: String, required: [true, 'Please add a description'], maxlength: [500, 'Descr..
Occured Errors [TDD, Express] Cannot overrite model once compiled Mongoose "https://stackoverflow.com/questions/19051041/cannot-overwrite-model-once-compiled-mongoose" I brought in "user.spec.js" "const User = require('../models/user');" and brought in "auth.js" "const User = require('../models/User');" defined with diffrent speling. that make occred this error. Cannot get req.params when route to another route. we need to d..
Make authentication API with TDD [express] The first thing I will do is defining User model. after this, authentication process is wating(login, sign up, etc). Let's just put minimum fieds that we need. [name, email, role, password] const mongoose = require('mongoose'); const bcrypt = require('bcryptjs');// used when hashing password. const UserSchema = new mongoose.Schema({ name: { type: String, required: [true, 'Please add a name'] }, ..
How to show joined models [mongoose] MongoDB doesn't have "join". Instead join, mongoose Uses "virtaul" and "populate" First, take a look at models. ProductSchema // app/model/product.js const ProductSchema = new mongoose.Schema( { name: { type: String, maxlength: 50 }, description: { type: String, maxlength: 1000 }, { toJSON: { virtuals: true }, toObject: { virtuals: true }, } }); // Reverse populate with virtuals ProductSchema.vi..