forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
42 lines (33 loc) · 994 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('/access-token.js', browserify('./debug/access-token.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');
});