标签:
创建文件夹 mkdir go-activity
在当前目录中创建一个 package.json
文件。可以通过 npm init
命令来完成此工作。
当前目录安装express npm install express --save,目录结构如下图
然后就开始撸代码了
extends layout block content .content .content-heading .container .content-inner .container .progress .progress-bar-indeterminate .region 地区: span 厦门 div.row div.col-md-6 label.floating-label(for=‘text_search‘,style=‘margin-left:17px‘) 请输入关键字 input#text_search.form-control div.col-md-2 button.btn.btn-alt.waves-button.waves-effect.waves-light 查询 .card-wrap .row.row-fix each val, index in activities .col-lg-3.col-md-4.col-sm-6 .card .card-main .card-inner p.card-heading.text-alt= val.title p= val.content .card-action ul.nav.nav-list.pull-left li a(href=‘javascript:void(0)‘) i.fa.fa-thumbs-o-up= val.nbCount li a(href=‘javascript:void(0)‘) i.fa.fa-star-o li a(href=‘javascript:void(0)‘) i.fa.fa-comment-o
var express = require(‘express‘); var router = express.Router(); /* GET home page. */ router.get(‘/‘, function(req, res, next) { res.render(‘index‘, {title: ‘活动起来‘ ,activities:[ {title:‘周末打篮球约起来‘,content:‘学生公寓打球求一起,自带干粮‘,nbCount:33}, {title:‘麻将三缺一‘,content:‘海边打麻将吹风‘}, {title:‘测试一‘,content:‘π等于多少...‘}, {title:‘测试二‘,content:‘***********‘}] }); }); module.exports = router;
标签:
原文地址:http://my.oschina.net/luoyezhiqiu/blog/494822