Commit d089dc25 authored by james's avatar james

[ADD] 更新說明

parent eedab674
var express = require('express');
var app = express();
// set the view engine to ejs
// 設定模板引擎 EJS
app.set('view engine', 'ejs');
// use res.render to load up an ejs view file
// index page
// 首頁
app.get('/', function(req, res) {
res.render('pages/index');
res.render('pages/index',{title:'首頁'});
});
// about page
// 關於
app.get('/about', function(req, res) {
res.render('pages/about');
res.render('pages/about',{title:'關於'});
});
app.listen(8080);
......
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../partials/head'); %>
</head>
<body class="container">
<header>
<%- include('../partials/header'); %>
</header>
<main>
<div class="row">
<div class="col-sm-8">
<div class="jumbotron">
<h1><%= title %></h1>
<p>Welcome to templating using EJS</p>
</div>
</div>
</div>
</main>
<footer>
<%- include('../partials/footer'); %>
</footer>
</body>
</html>
\ No newline at end of file
......@@ -11,7 +11,7 @@
<main>
<div class="jumbotron">
<h1>Hello World!</h1>
<h1><%= title %></h1>
<p>Welcome to templating using EJS</p>
</div>
</main>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment