forked from browserify/wzrd.in
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.js
21 lines (16 loc) · 880 Bytes
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
const auth = require('./middlewares/auth');
const bodyParser = require('body-parser');
const cullHandler = require('./handlers/cull');
const singularHandler = require('./handlers/singular');
const multiHandlers = require('./handlers/multiple');
const statusesHandler = require('./handlers/statuses');
module.exports = function (app, bundler, config) {
app.get('/bundle/:slug', singularHandler(bundler));
app.get('/debug-bundle/:slug', singularHandler(bundler, { debug: true }));
app.get('/standalone/:slug', singularHandler(bundler, { standalone: true }));
app.get('/debug-standalone/:slug', singularHandler(bundler, { standalone: true, debug: true }));
app.post('/multi', bodyParser.json({type:'*/*'}), multiHandlers.create(bundler));
app.get('/multi/:bundle', multiHandlers.get(bundler));
app.get('/status/:bundle', statusesHandler(bundler));
}