(url, fn, filePath)
| 76 | |
| 77 | |
| 78 | function route(url, fn, filePath) { |
| 79 | if (url.charAt(0) !== '/') { url = '/'+url; } |
| 80 | // console.log('route defined',url); |
| 81 | var point = getPoint(url); |
| 82 | if (point) { |
| 83 | if (fn) { point.handle = fn; } |
| 84 | if (filePath) { point.filePath = filePath; } |
| 85 | } else { |
| 86 | point = new KnownPoint(url, fn, filePath); |
| 87 | if (!fn) { |
| 88 | debug('added known point %s pointing to static file %s',url,filePath); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | return { |
| 94 | get middleware() { |