|
1 | 1 | var debug = require('debug')('ldnode:ws-app') |
2 | 2 | var SolidWs = require('./lib/server') |
| 3 | +var path = require('path') |
3 | 4 |
|
4 | 5 | module.exports = function attachToServer (server, app, opts) { |
5 | 6 | var solidWs = new SolidWs(server, opts) |
6 | 7 |
|
7 | 8 | if (app) { |
8 | | - console.log("setting up the app") |
| 9 | + console.log('setting up the app') |
9 | 10 |
|
10 | 11 | app.post('/*', function (req, res, next) { |
11 | | - debug("pub " + req.originalUrl + ' after post') |
| 12 | + debug('pub ' + req.originalUrl + ' after post') |
12 | 13 | solidWs.publish(req.originalUrl) |
13 | 14 | solidWs.publish(path.basename(req.originalUrl)) |
14 | 15 | next() |
15 | 16 | }) |
16 | 17 | app.patch('/*', function (req, res, next) { |
17 | | - debug("pub " + req.originalUrl + ' after patch') |
| 18 | + debug('pub ' + req.originalUrl + ' after patch') |
18 | 19 | solidWs.publish(req.originalUrl) |
19 | 20 | console.log(solidWs.store) |
20 | 21 | next() |
21 | 22 | }) |
22 | 23 | app.put('/*', function (req, res, next) { |
23 | | - debug("pub " + req.originalUrl + ' after put') |
| 24 | + debug('pub ' + req.originalUrl + ' after put') |
24 | 25 | solidWs.publish(req.originalUrl) |
25 | 26 | next() |
26 | 27 | }) |
27 | 28 | app.delete('/*', function (req, res, next) { |
28 | | - debug("pub " + req.originalUrl + ' after delete') |
| 29 | + debug('pub ' + req.originalUrl + ' after delete') |
29 | 30 | solidWs.publish(req.originalUrl) |
30 | 31 | solidWs.publish(path.basename(req.originalUrl)) |
31 | 32 | next() |
|
0 commit comments