๋ชฉ๋ก๐ฉ๐ป ๋ฐฑ์๋(Back-End)/Node js (108)
๐ ๊ณต๋ถํ๋ ์ง์ง์ํ์นด๋ ์ฒ์์ด์ง?
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dXr3Oi/btr4xhQHEgm/6joG2OlKC7QMoFNjKa7Uxk/img.png)
=> Node.js With Passport Authentication | Full Project => authentication app with login, register and access control using Node.js, Express, Passport, Mongoose ๐ฅ ํจ์ค์๋ ํด์ํจ์ bcrypt : hash ํจ์๋ฅผ ์ด์ฉํด ์ ๋ณด๋ฅผ ์ํธํ ํ ์ ์๋๋ก ํด์ฃผ๋ Node.js ํจํค์ง // bcrypt ๋ถ๋ฌ์ค๊ธฐ - commonjs const bcrypt = require("bcrypt") // ํด์ ํจ์๋ก ๋น๋ฐ๋ฒํธ ์ํธํํด์ ๋ณ์์ ์ ์ฅํ๊ธฐ const encrypted = bcrypt.hash("๋น๋ฐ๋ฒํธ", ํด์ํจ์ ๋ฐ๋ณต ํ์) ๐ฅ redirect ์ render ์ฐจ์ด res.redire..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/duA9zH/btr35v3rPf2/bugLknIqqSvuzCpVgTnK3k/img.png)
=> Node.js With Passport Authentication | Full Project => authentication app with login, register and access control using Node.js, Express, Passport, Mongoose ๐ฅ DB์ ์ ์ฅํ User Schema & ํ์๊ฐ์ ์ ๊ท์น ์์งํค๋ฉด message ๋์ฐ๊ธฐ ๐ง models/User.js User schema ์์ฑ const mongoose = require("mongoose"); const UserSchema = new mongoose.Schema({ name: { type: String, required: true }, email: { type: String, required: tru..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/8Tz9Z/btr3U4xMr5A/36yo4Pc9cqrjRKLKKFsuI1/img.png)
=> Node.js With Passport Authentication | Full Project => authentication app with login, register and access control using Node.js, Express, Passport, Mongoose ๐ฅ ํ์๊ฐ์ DB ๋ฃ๊ธฐ ๐ง app.js const express = require("express"); const expressLayouts = require("express-ejs-layouts"); const mongoose = require("mongoose"); require("dotenv").config(); const app = express(); // DB config const db = process.env...
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/2PYSL/btr3S2mUIL7/yiJHiMcMWa7thzixmkeB41/img.png)
=> Node.js With Passport Authentication | Full Project => authentication app with login, register and access control using Node.js, Express, Passport, Mongoose ๐ฅ Dashboard ํ์ด์ง ๐ง views/dashboard.ejs Dashboard Welcome Logout ๐ฅ MongoDB ์ฐ๊ฒฐํ๊ธฐ ๐ง app.js const express = require("express"); const expressLayouts = require("express-ejs-layouts"); const mongoose = require("mongoose"); require("dotenv").conf..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/ek26C4/btr3QyNqcsK/Wtx50PvPX4ee1h5xBcX32k/img.png)
=> Node.js With Passport Authentication | Full Project => authentication app with login, register and access control using Node.js, Express, Passport, Mongoose ๋ฐ๋ผํ๋ค๊ฐ bootstrap ์ ์ ์ฉ๋ผ์ ์ ๋ถ์ ๊นํ๋ธ ์ฐธ๊ณ ํจ.. ๐ฅ ๋ก๊ทธ์ธ & ํ์๊ฐ์ ํ์ด์ง ์์๊ฒ ๋ณ๊ฒฝํ๊ธฐ ๐ง app.js const express = require("express"); const expressLayouts = require("express-ejs-layouts"); const app = express(); // ejs ๋ฏธ๋ค์จ์ด app.use(expressLayouts); // express ์ vi..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bqwUaC/btr3IZrwGVo/YN4ehMQyMhuanT0pKnKZ3K/img.png)
=> Node.js With Passport Authentication | Full Project => authentication app with login, register and access control using Node.js, Express, Passport, Mongoose ๐ฅ ejs (Embedded JavaScript) : JavaScript๋ก HTML ๋งํฌ ์ ์ ์์ฑ ํ ์์๋ ๊ฐ๋จํ ํ ํ๋ฆฟ ์ธ์ด ( view๋ฅผ ๋์ ์ผ๋ก ์์ฑํ๋ ํ ํ๋ฆฟ ์ธ์ด ) ์ฐธ๊ณ => https://noodler.tistory.com/26 ํ๋ฆ ์ ์ด๋ฌธ ๋ณ์ ๊ฐ ์์ฝ์ด ๋ค๋ฅธ viewํ์ผ์ ๋ถ๋ฌ ์ด ๐ฅ ejs ์ฐธ๊ณ ์ฌ์ดํธ (bootstrap.min.css) https://bootswatch.com/ Bootswatch: ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/CARZb/btr3lC2YNWj/RLp0e0I3gViWLWVJIcrFb1/img.png)
=> Node.js With Passport Authentication | Full Project => authentication app with login, register and access control using Node.js, Express, Passport, Mongoose ๐ฅ ํ๊ฒฝ ์ธํ : npm ์ ํตํด ์๋์ ํจํค์ง๋ฅผ ์ค์นํ๊ธฐ ๐ฅ ์๋ฒ ๋์ฐ๊ธฐ ๐ง app.js const express = require("express"); const app = express(); // Routes app.use("/", require("./routes/index")); app.use("/users", require("./routes/user")); const PORT = process.env.PORT ||..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/mGkpz/btr3kw87GQz/ZvoB5l46BX3Wd6wIQoUlbk/img.png)
=> CRUD App With Image Upload Using NodeJs, ExpressJs, MongoDB & EJS Templating Engine ๐ฅ user์ ํ๋กํ ๋ชฉ๋ก์ ์์ฑํ๊ณ ์์ ํ๊ณ ์ญ์ ํ๊ณ MongoDB์ ์ ์ฅํ๊ธฐ ์ฐธ๊ณ : https://github.com/gani0325/2023/tree/main/Web/ImageUpload ๐ง models/user.js const mongoose = require("mongoose"); const userSchema = new mongoose.Schema({ name: { type: String, required: true, }, email: { type: String, required: true, }, phone: { type: String, ..