-
Notifications
You must be signed in to change notification settings - Fork 15
/
server.js
42 lines (32 loc) · 1.05 KB
/
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('/gl-draw-foxgis.js', browserify('./index.js', {
standalone: 'MapboxDraw',
debug: true,
cache: 'dynamic',
minify: false
}));
app.get('/mapbox-gl.js', browserify('./node_modules/mapbox-gl/js/mapbox-gl.js',{
standalone: 'mapboxgl',
debug: true,
cache: 'dynamic'
}));
app.get('/mapbox-gl.css', function(req, res) {
res.sendFile(__dirname+ '/node_modules/mapbox-gl/dist/mapbox-gl.css');
});
app.get('/bench/index.js', browserify('./bench/index.js', {
transform: ['unassertify', 'envify'],
debug: true,
minify: true,
cache: 'dynamic'
}));
app.get('/bench/:name', function(req, res) {
res.sendFile(__dirname + '/bench/index.html');
});
app.use('/debug', express.static(__dirname + '/debug'));
app.use('/dist', express.static(__dirname + '/dist'));
var port = process.env.PORT || 9967;
app.listen(port, function () {
console.log('gl-draw-foxgis debug server running at http://localhost:' + port);
});