forked from max-mapper/earlyalameda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
21 lines (19 loc) · 743 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var logging = require('logref')
logging.stdout()
process.logging = logging
var tako = require('tako')
, http = require('http')
, path = require('path')
, Rewriter = require('Rewriter')
, rewrites = [
{"from":"/", "to":"index.html"}
// , {"from":"/api/search", "to":"../../../_search/social_services/social_services/_search"} // github.com/open211/redirectory/wiki/Installation
, {"from":"/api", "to":"/"}
, {"from":"/api/*", "to":"/*"}
, {"from":"/*", "to":'*'}
]
;
var t = tako()
new Rewriter(t, rewrites, {verbose: true, root: "http://max.ic.ht/earlyalameda/_design/app", attachments: path.resolve(__dirname, 'attachments')})
t.httpServer.listen(9999)
console.log('listening on 9999')