-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathte.js
More file actions
43 lines (34 loc) · 1.03 KB
/
Copy pathte.js
File metadata and controls
43 lines (34 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'use strict'
var Koa = require('koa');
var path = require('path');
var wechat = require('./wechat/g');
//var config = require('./config');
// var reply = require('./wx/reply');
var appKoa = new Koa();
var ejs = require('ejs');
var heredoc = require('heredoc');
var tpl = heredoc(function (){/*
<!DOCTYPE html>
<html>
<head>
<title>JACK TEST</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
</head>
<body>
<h1>点击测试</h1>
<p id="title"></p>
<div id="poster"></div>
<script src="http://zeptojs.com/zepto-docs.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
</body>
</html>
*/});
appKoa.use(function *(next) {
if (this.url.indexOf('/visit') > -1) {
this.body = ejs.render(tpl, {});
return next;
}
yield next;
});
//appKoa.use(wechat(config.wechat, reply.reply));
appKoa.listen(1234);