Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
唐斌
committed
Jun 18, 2014
1 parent
3b17ed7
commit 91b5e11
Showing
4 changed files
with
96 additions
and
26 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
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,48 @@ | ||
var express = require('express'); | ||
var template = require('../node/template.js'); | ||
|
||
|
||
var app = module.exports = express(); | ||
|
||
template.config('extname', '.html'); | ||
app.engine('.html', template.__express); | ||
app.set('view engine', 'html'); | ||
app.set('views', __dirname + '/node-template'); | ||
|
||
|
||
var demoData = { | ||
title: '国内要闻', | ||
time: (new Date).toString(), | ||
list: [ | ||
{ | ||
title: '<油价>调整周期缩至10个工作日 无4%幅度限制', | ||
url: 'http://finance.qq.com/zt2013/2013yj/index.htm' | ||
}, | ||
{ | ||
title: '明起汽油价格每吨下调310元 单价回归7元时代', | ||
url: 'http://finance.qq.com/a/20130326/007060.htm' | ||
}, | ||
{ | ||
title: '广东副县长疑因抛弃情妇遭6女子围殴 纪检调查', | ||
url: 'http://news.qq.com/a/20130326/001254.htm' | ||
}, | ||
{ | ||
title: '湖南27岁副县长回应质疑:父亲已不是领导', | ||
url: 'http://news.qq.com/a/20130326/000959.htm' | ||
}, | ||
{ | ||
title: '朝军进入战斗工作状态 称随时准备导弹攻击美国', | ||
url: 'http://news.qq.com/a/20130326/001307.htm' | ||
} | ||
] | ||
}; | ||
|
||
app.get('/', function(req, res){ | ||
res.render('index', demoData); | ||
}); | ||
|
||
/* istanbul ignore next */ | ||
if (!module.parent) { | ||
app.listen(3000); | ||
console.log('Express started on port 3000'); | ||
} |
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
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 |
---|---|---|
@@ -1,22 +1,26 @@ | ||
{ | ||
"name" : "art-template", | ||
"description" : "JavaScript Template Engine", | ||
"homepage" : "http://aui.github.com/artTemplate/", | ||
"keywords" : ["util", "functional", "template"], | ||
"author" : "tangbin <sugarpie.tang@gmail.com>", | ||
"repository" : {"type": "git", "url": "git://github.com/aui/artTemplate.git"}, | ||
"main" : "./node/template.js", | ||
"version" : "3.0.0", | ||
"name": "art-template", | ||
"description": "JavaScript Template Engine", | ||
"homepage": "http://aui.github.com/artTemplate/", | ||
"keywords": [ | ||
"util", | ||
"functional", | ||
"template" | ||
], | ||
"author": "tangbin <sugarpie.tang@gmail.com>", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/aui/artTemplate.git" | ||
}, | ||
"main": "./node/template.js", | ||
"version": "3.0.1", | ||
"devDependencies": { | ||
"grunt-cli": "*", | ||
"express": "~4.4.3", | ||
"grunt-cli": "*", | ||
"grunt": "*", | ||
"grunt-contrib-jshint": "*", | ||
"grunt-contrib-concat": "*", | ||
"grunt-contrib-uglify": "*" | ||
}, | ||
"license" : "BSD" | ||
"license": "BSD" | ||
} | ||
|
||
|
||
|
||
|