Nodejs 实战开发留言板案例
准备第三方包
- express
- art-template
- body-parse
以上第三方包需要安装到你的项目中
npm install express -s
npm install art-template -s
npm install body-parse -s
index.html 代码如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>留言主页面--模板渲染</title>
<link rel="stylesheet" href="/lib/bootstrap/bootstrap.css">
</head>
<body>
<div class="header container">
<div class="page-header">
<h1>Example page header <small>Subtext for header</small></h1>
<a class="btn btn-success" href="/post">发表留言</a>
</div>
<