본문 바로가기

반응형

Web

(20)
[Next.js] "unhandledRejection: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client" 오류 https://cocoon1787.tistory.com/714
[node.js] express route 사용 방법 ! app.get("/tech", (req, res) => { res.sendFile(__dirname + "/public/html/02_tech.html"); }); app.get("/perform", (req, res) => { res.sendFile(__dirname + "/public/html/03_perform.html"); }); app.get("/field", (req, res) => { res.sendFile(__dirname + "/public/html/04_field.html"); }); app.get("/contact", (req, res) => { res.sendFile(__dirname + "/public/html/05_contact.html"); }); 이렇게 줄줄이 적힌 app.g..
[Node.js] ERROR : Refused to apply style from 'http://localhost:5000/resource/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. ( 일단 간단한 html + css 파일 덩어리 ! 퍼블리셔에게 넘겨 받아서 node.js server에 올릴 목적으로 작업을 진행하였다. 매우 간단하다고 생각하였는데 문제가 발생했다. const express = require("express"); const port = process.env.PORT || 5000; const app = express(); app.use(express.json()); app.use(express.urlencoded()); //api routes app.get("/", (req, res) => { res.sendFile(__dirname + "/public/index.html"); }); app.post("/post", (req, res) => { console.log(re..
[Docker] : dockerfile 작성-> image 생성 -> Container 생성 및 운영 그리고 DockerHub에 push 마무리 @@@ const express = require('express'); const app = express(); app.get('/',(req,res)=> { res.send("👻 CentumJoonho in Docker !!👻"); }); app.listen(8088,() =>console.log("server is running😈")); -> express 통해서 간단하게 서버를 운영해보았다. docker 사용법 Dockerfile 생성 -> 물론 그전에 Visual Studio Code -> extension -> Docker 설치해야함 FROM node:16-alpine # 사용할 베이스 이미지 WORKDIR /app # 이미지 안에서 어디 경로로 어플리케이션을 복사해 올 것인지 # 레이어 시스템 : 순..

반응형