[Node.js] express

Jiho Park·2022년 2월 5일
0
post-thumbnail

개발 환경 세팅

node 설치 >
macOs 환경에서는 homebrew를 통해 설치 가능하다

"brew install node "

IDE : Vscode
형상관리 : git - github 연동

express

"npm install express --save"

server open

app.js

const express = require("express");
const app = express();

app.get("/",(req,res)=>{
    res.send("check to route");
});

app.get("/login", (req, res)=>{
    res.send("check to login");
});

app.listen(3000, () =>{
    console.log("server open");
});

실행 결과

스프링 프레임워크보다 빠르게, 서버 띄울 수 있었다

[npm / express infomation]
https://www.npmjs.com/package/express

The Express philosophy is to provide small, robust tooling for HTTP servers, 
making it a great solution for single page applications, websites, hybrids, or public HTTP APIs.

Express does not force you to use any specific ORM or template engine.
With support for over 14 template engines via Consolidate.js, you can quickly craft your perfect framework.

https://github.com/brightmeaning/node-basic

0개의 댓글