본문 바로가기

전체 글164

WEBPACK WEBPACK is module bundler 많은 파일들을 가져와서, webpack에게 주면, webpack은 static 파일로 변환해준다.(브라우저도 알아들을 수 있도록 해준다.) file => webpack => file (compatible files) for browser. ***npm install webpack webpack-cli*** => webpack-cli는 터미널에서 webpack을 쓸 수 있게 해준다. ***webpack.config.js 파일 생성*** package.json 에서, 노드 서버와, webpack이 다르게 running 할 수 있도록 만들어주면 편리하다. ex) "dev:assets": "WEBPACK_ENV=development webpack", "build:a.. 2020. 2. 11.
regular expression and option ESlint는 에러를 잡는데 도움을 준다. for code structure npm install eslint videos = await VideoModel.find({ title: { $regex: searchingBy, $options: "i" } }); regular expression을 통해 SEARCH 기능, 검색을 하면 데이터 값을 불러온다. $option: "i" means insensitive. => 대문자, 소문자 상관 없이 데이터를 불러올 수 있다. https://docs.mongodb.com/manual/reference/operator/query/or/ export const searchControllerGlobal = async (req, res) => { const { query.. 2020. 2. 10.
Web page => 라우터(id) => 컨트롤러(id) logic => render page web page 버튼 클릭 => 라우터 (서버) => 컨트롤러 logic => render page 1. Delete Video 버튼을클릭 -> videoRouter.get(routes.deleteVideo(),videosDeleteController); 2. 라우터 파일에 있는 deleteVideo 실행 -> *const DELETE_VIDEO = "/:id/delete"; *deleteVideo: id => { if (id) { return `/videos/${id}/delete`; } else { return DELETE_VIDEO; } } videoRouter.js파일에 있는 videoRouter.get(routes.deleteVideo(), deleteVideo); 에서routes.deleteV.. 2020. 2. 9.
Absolute vs Relative Paths/LINKS & Express _id 상대경로 vs 절대경로 You must use absolute paths when linking to another Website, but you can also use absolute paths within your own website. Absolute paths provide the complete website address where you want the user to go. 링크 => https://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/ *Node JS EXPRESS DOESN'T NEED 'ID'. EXPRESS needs THE 'PARAMETER' https://sailsjs.com/documentation/r.. 2020. 2. 8.