Express (2) 썸네일형 리스트형 nodejs router에 대해 알아보자 router는 설정한 경로를 찾아가서 해당 하는 모듈을 실행을 시킨다. 가령 html에서 A.html, B.html파일이 있다고 생각해 보자. A.html에서 B.html로 이동하고 싶으면 A.html에서 B 화면으로 이동 작성하고 해당 영역을 클릭하면 B.html 화면으로 이동한다. nodejs는 각각의 url에 따른 다른 모듈을 접근할 때에 router 설정이 필요하다. router 설정방법 (nodejs express 프로젝트로 생성) 경로 : app.js var createError = require('http-errors'); var express = require('express'); var path = require('path'); var cookieParser = require('cooki.. node js 설치방법 https://nodejs.org/en/ Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 최신버전으로 설치 설치가 완료되면 express node js 웹 프레임워크 설치해서 구현 npm install express-generator -g npm(자바스크립트 프로그래밍 언어를 위한 패키지 관리자) npm 이용해서 express을 설치한다. express 기반 node js 프로젝트 생성 express [프로젝트 명] 실행화면 폴더 구조 생성된 nodejs [back] 프로젝트 (front 폴더는 vuejs 프로젝트 폴더) back 폴더로 이동 후 express 의존된 모듈을 설치 (pack.. 이전 1 다음