-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yeah!
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//JavaScript를 배우고 싶어져서 소마센터에 있던 책에 써있던 예제코드를 실행해 본 것 | ||
var http = require('http'); | ||
http.createServer(function(req, res){ | ||
var path=req.url.replace(/\/?(?:\?.*)?$/, '').toLowerCase(); | ||
switch(path){ | ||
case '': | ||
res.writeHead(200, {'Content-Type': 'text/plain'}); | ||
res.end('Hello, 0XD happckathon 2018!'); | ||
break; | ||
case '/about': | ||
res.writeHead(200, {'Content-Type': 'text/plain'}); | ||
res.end('About'); | ||
break; | ||
default: | ||
res.writeHead(404, {'Content-Type': 'text/plain'}); | ||
res.end('Not Found :('); | ||
break; | ||
} | ||
}).listen(3000); | ||
console.log('Server started on localhost:3000; press Ctrl+C to terminate'); | ||
//파일 저장 안 해놓고 서버가 안 열려서 당황했던 기억이... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# 무엇? | ||
이미지 파일을 모아놓은 디렉토리입니다! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# 여긴 또 무엇? | ||
리소스 파일을 모아놓은 디렉토리입니다! |