
HTTP Module - Node.js에서 가장 기본적인 웹 모듈(내장 모듈)이며 HTTP 웹 서버를 생성하는 것과 관련된 모든 기능을 담당 - http 모듈 대신 HTTP 요청에 대하여 라우팅 및 미들웨어 기능을 제공하는 웹 프레임워크인 express.js등을 사용 Spring 이용 시 servlet구현하기가 쉬운 것과 비슷한 느낌? 1. 서버 생성 및 실행 Ctrl+C로 서버 닫기 2. 서버 실행 후 html파일 불러오기 파일다루기 C:\node.js>node server2.js var fs = require("fs"); var http = require("http"); http.createServer(function(req,resp){ fs.readFile("hello.html",function (..

1. Console 객체 예) time함수를 이용해 프로그램 실행 시간을 측정하는 프로그램 ... ... ... 3. expert 객체와 모듈 모듈을 생성할 때 exports 객체를 사용하며, 자바스크립트에서 모듈을 추출할때 require()함수를 사용. var user = require("./user.js"); 상위 폴더 밑에 (=현재폴더) user.js 먼저 user.js파일을 찾으며, 있으면 그 파일을 추출한다. user.js 파일이 없는 경우, user라는 폴더를 찾아 index.js파일을 찾아 추출한다. > console.log(user.rect(1,2)); 추출한 모듈의 함수 사용.

모듈 node.js에서 기능 확장을 위해 사용하는 개념. 내부에 기본적으로 있는 모듈을 내부모듈이라고 한다. const os = require(모듈명); 모듈을 사용하려면 먼저 로딩을 해야한다. 더보기 C:\node.js>node Welcome to Node.js v12.14.1. Type ".help" for more information. > const os = require("os"); undefined > console.log(os); { arch: [Function: arch] { [Symbol(Symbol.toPrimitive)]: [Function] }, cpus: [Function: cpus], endianness: [Function: endianness] { [Symbol(Symbol.t..

더보기 C:\Users\sist>cd \node.js C:\node.js>node Welcome to Node.js v12.14.1. Type ".help" for more information. > console.log("hello..."); hello... undefined > var a=1+2; undefined > console.log(a); 3 undefined 더보기 > .editor // Entering editor mode (^D to finish, ^C to cancel) var x=5; console.log(x); //Ctrl+D로 종료. 5 undefined 더보기 > 10+5 15 > 2**10 1024 > > var x=10; undefined > var s=0; undefined..
- Total
- Today
- Yesterday
- 맥세팅
- 맥 크롬 다운로드
- 리눅스마스터2급2차
- 정렬
- 인프런
- 정처기
- Mac cpu모델명
- 난이도B
- 난이도C
- 2020정처기실기1회
- 알고리즘
- mac세팅
- 2장요구사항확인
- 정보처리기사
- mac크롬
- 2021정처기실기1회대비
- 리눅스마스터2급실기
- 백준
- 권오흠
- 스택
- 프로그래머스
- 맥 크롬설치
- Mac cpu
- 정처기실기
- //축
- 자료구조
- 정보처리기사실기
- K번째수
- Java
- 2021정처기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |