haenim

add main page

This diff is collapsed. Click to expand it.
......@@ -3,4 +3,9 @@ module.exports = function(app)
app.get('/',function(req,res){ //index.html 가져오기
res.render('index.html')
});
app.get('/timeline/:id',function(req,res){
res.render('timeline.html')
});
}
......
......@@ -6,8 +6,8 @@ app.set('views', __dirname + '/views'); //서버가 읽을 수 있도록 HTML
app.set('view engine', 'ejs'); //서버가 HTML 렌더링을 할 때, EJS 엔진을 사용하도록 설정합니다.
app.engine('html', require('ejs').renderFile);
var server = app.listen(3000, function(){
var server = app.listen(3000, function(){ //3000 포트 사용
console.log("Express server has started on port 3000")
})
app.use(express.static('public')); //css같은 거 사용
app.use(express.static('public'));
......
<html>
<head>
<title>Main</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="author" content="colorlib.com">
<link href="https://fonts.googleapis.com/css?family=Poppins" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />
</head>
<body>
Hey, this is index page
</body>
</html>
\ No newline at end of file
<div class="s130">
<form>
<div class="inner-form">
<div class="input-field first-wrap">
<div class="svg-wrapper">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg>
</div>
<input id="search" type="text" placeholder="아이디를 입력하세요" />
</div>
<div class="input-field second-wrap">
<button class="btn-search" type="button" onclick="movePage()">SEARCH</button>
</div>
<script type ="text/javascript">
function movePage(){ //페이지 이동을 위한 함수
location.href ="/timeline/"+document.getElementById('search').value
}
</script>
</div>
<span class="info">ex)@TwitterKorea </span>
</form>
</div>
<script src="js/extention/choices.js"></script>
</body><!-- This templates was made by Colorlib (https://colorlib.com) -->
</html>
......
<html>
<body>
<script>
alert("Hello, world!");
</script>
</body>
</html>
\ No newline at end of file