[Node.js] Express 프레임워크로 웹 화면에 Hello World 출력
Express framework: https://www.npmjs.com/package/express
express
Fast, unopinionated, minimalist web framework. Latest version: 4.18.2, last published: 7 months ago. Start using express in your project by running `npm i express`. There are 71870 other projects in the npm registry using express.
www.npmjs.com
공식 홈페이지: https://expressjs.com/ko/starter/hello-world.html
Express "Hello World" 예제
Hello world 예제 기본적으로 이 앱은 여러분이 작성할 수 있는 가장 간단한 Express 앱일 것입니다. 이 앱은 하나의 파일로 된 앱이며 Express 생성기를 통해 얻게 되는 앱과는 같지 않습니다. (이 예제
expressjs.com
Step 1. Terminal에 npm install express 를 입력하여 express를 설치
Step 2. 위 링크의 예시 코드를 복사 후 index.js에 붙여넣기
Step 3. Terminal에 node index.js로 실행
Step 4. 크롬과 같은 웹 브라우저의 주소창에 localhost:3000 또는 127.0.0.1:3000 을 검색한 후 웹 화면의 출력 결과를 확인
'Development' 카테고리의 다른 글
[Clean Code] 클린 코드 (0) | 2023.05.23 |
---|---|
[ChatBot] Dialogflow를 활용한 콘도 예약·신청 챗봇 구축 (0) | 2023.05.09 |
[API] fetch()를 이용한 날씨 API 불러오기 실습 (0) | 2023.05.08 |
[JS] ES6 템플릿 리터럴: 백틱(``)과 달러(${}) 사용법 (0) | 2023.05.08 |
[Node.js] npm 이해를 위한 간단한 figlet 실습 (0) | 2023.05.08 |