-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathserver.js
More file actions
27 lines (18 loc) · 762 Bytes
/
server.js
File metadata and controls
27 lines (18 loc) · 762 Bytes
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
var taco = require('tako')
, request = require('request')
, path = require('path')
, filed = require('filed')
, app = taco()
var tileset = 'toner-background'
// getImageData has separate same origin policy,
// proxy for pixel manipulation:
app.route('/' + tileset + '/*', function (req, resp) {
request("http://tile.stamen.com"+req.url).pipe(resp)
})
app.route('/').files(path.join(__dirname, 'index.html'));
app.route('/more').files(path.join(__dirname, 'ex/post.html'));
app.route('/ex/*').files(path.join(__dirname, 'ex'));
app.route('/lib/*').files(path.join(__dirname, 'lib'));
app.route('/style/*').files(path.join(__dirname, 'style'));
app.route('/devtiles/*').files(path.join(__dirname, 'localtilecache'));
app.httpServer.listen(8002)