-
Notifications
You must be signed in to change notification settings - Fork 11
/
server.js
42 lines (33 loc) · 978 Bytes
/
server.js
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
var express = require('express');
var app = express();
var browserify = require('browserify-middleware');
app.get('/mapbox-gl.js', browserify('./js/mapbox-gl.js', {
standalone: 'mapboxgl',
debug: true,
cache: 'dynamic',
precompile: true
}));
app.get('/site.js', browserify('./debug/site.js', {
transform: ['envify'],
debug: true,
cache: 'dynamic',
precompile: true
}));
app.get('/bench/index.js', browserify('./bench/index.js', {
transform: ['unassertify', 'envify'],
debug: true,
minify: true,
cache: 'dynamic',
precompile: true
}));
app.get('/bench/:name', function(req, res) {
res.sendFile(__dirname + '/bench/index.html');
});
app.get('/debug', function(req, res) {
res.redirect('/');
});
app.use(express.static(__dirname + '/debug'));
app.use('/dist', express.static(__dirname + '/dist'));
app.listen(9966, function () {
console.log('mapbox-gl-js debug server running at http://localhost:9966');
});