From e48d3489a97445489393f5bf1593201a3aa5ae46 Mon Sep 17 00:00:00 2001 From: snpark Date: Sat, 8 May 2021 09:23:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Commit=20tamplete=EC=9D=84=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=ED=95=B4=EB=9D=BC=20Pull=20request=EB=A5=BC=20?= =?UTF-8?q?=ED=95=B4=EB=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -.gitconfig 파일에 -[commit] - template : ../../.gitmessage.txt -이런 설정을 해놓으면 적용이 된다. -git commit 옵션없이 하면 탬플릿 파일이 vi로 열린다. -저장하고 나가면 커밋이 완료된다. -다만 푸쉬가 안돼서 브랜치를 지우고 다시 만들었다. --- BACK/snpark/.gitconfig | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 BACK/snpark/.gitconfig diff --git a/BACK/snpark/.gitconfig b/BACK/snpark/.gitconfig new file mode 100644 index 0000000..b2b6b1b --- /dev/null +++ b/BACK/snpark/.gitconfig @@ -0,0 +1,7 @@ +# This is Git's per-user configuration file. +[user] +# Please adapt and uncomment the following lines: + name = snpark + email = atimangel@google.com +[commit] + ../../.gitmessage.txt From a9849b939e0ceefab9629cca169b159580b37977 Mon Sep 17 00:00:00 2001 From: snpark Date: Sat, 8 May 2021 20:21:01 +0900 Subject: [PATCH 2/2] Hello World MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -https://wikibook.co.kr/article/what-is-expressjs/ 여기 있는 예시 따라만들어보기 -http 프로토콜 명령이 익숙지 않다. -데이터를 줄 때는 res를 쓰고, 받을 때는 req를 쓰는 가보다. 얘내들의 부모 클래스는 누굴까? \#6 --- BACK/snpark/hello.js | 11 +++++++++++ BACK/snpark/hello_name.js | 17 +++++++++++++++++ BACK/snpark/package.json | 15 +++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 BACK/snpark/hello.js create mode 100644 BACK/snpark/hello_name.js create mode 100644 BACK/snpark/package.json diff --git a/BACK/snpark/hello.js b/BACK/snpark/hello.js new file mode 100644 index 0000000..4adae2a --- /dev/null +++ b/BACK/snpark/hello.js @@ -0,0 +1,11 @@ +var express = require("express"); +var app = express(); +var port = 3000; + +app.get("*", function(req, res){ + res.end("Hello World"); +}); + +app.listen(port, function(){ + console.log("The server is running, please, open your browser at http://localhost:%s", port); +}); diff --git a/BACK/snpark/hello_name.js b/BACK/snpark/hello_name.js new file mode 100644 index 0000000..8cc5f5b --- /dev/null +++ b/BACK/snpark/hello_name.js @@ -0,0 +1,17 @@ +var express = require("express"); +var app = express(); +var port = 3000; + +app.get("/name/:user_name", function(req, res){ + res.status(200); + res.set("Content-type", "text/html"); + res.send("

Hello " + req.params.user_name +"

"); +}); + +app.get("*", function(req, res){ + res.end("Hello World"); +}); + +app.listen(port, function(){ + console.log("The server is running, please, open your browser at http://localhost:%s", port); +}); diff --git a/BACK/snpark/package.json b/BACK/snpark/package.json new file mode 100644 index 0000000..d0bb5dc --- /dev/null +++ b/BACK/snpark/package.json @@ -0,0 +1,15 @@ +{ + "name": "snpark", + "version": "1.0.0", + "description": "", + "main": "index.js", + "dependencies": { + "express": "^4.17.1" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +}