//index.js
let express = require("express");
let app = express();
app.listen(3000, function(){
console.log("App is running on port 3000");
});
app.get("/", function(req, res){
res.sendfile("index.html");
});
시작점으로서 가장 먼저 실행되는 파일
// package.json
{
"name": "project-name",
"version": "1.0.0",
"description": "",
"main": "index.js",
"author": "HEROPY",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"express": "^4.16.1"
}
}
프로젝트의 정보와 프로젝트에서 사용하는 패키지의 의존성을 관리
express
nodeJs 단순화하고 새로운기능을 쉽게 유용하게 사용할 수 있게 해줌
'Infla > Docker' 카테고리의 다른 글
1. [Seminar] Dockerfile 실습 - NodeJS Dockerfile 작성하기 (0) | 2021.01.04 |
---|---|
1. [Seminar] Dockerfile 설명 (0) | 2020.12.29 |
1. [Seminar] 도커 이미지 생성하는 순서 (0) | 2020.12.29 |
1. [Seminar] 실행중인 컨테이너에서 터미널 실행 ( exec ) (0) | 2020.12.29 |
1. [Seminar] 레디스 서버를 이용한 컨테이너 이해 (0) | 2020.12.29 |