Commit 38609af0c17eeb17b6fdfc36b436b93d73445836
simplify index.js
Dominic Tarr committed on 9/28/2016, 5:40:00 AMParent: 3c9b18facfb73339b585ecdd2141a23586ab0095
Files changed
index.js | changed |
index.js | |||
---|---|---|---|
@@ -1,33 +1,7 @@ | |||
1 | -var h = require('hyperscript') | ||
1 … | +require('depject')( | ||
2 … | + require('./modules'), | ||
3 … | + {'sbot-api.js': require('./sbot-api')()} | ||
4 … | +).plugs.app[0]() | ||
2 | 5 … | ||
3 | -window.addEventListener('error', window.onError = function (e) { | ||
4 | - document.body.appendChild(h('div.error', | ||
5 | - h('h1', e.message), | ||
6 | - h('big', h('code', e.filename + ':' + e.lineno)), | ||
7 | - h('pre', e.error ? (e.error.stack || e.error.toString()) : e.toString()))) | ||
8 | -}) | ||
9 | 6 … | ||
10 | -var u = require('./util') | ||
11 | -var pull = require('pull-stream') | ||
12 | -var combine = require('depject') | ||
13 | -var fs = require('fs') | ||
14 | -var path = require('path') | ||
15 | -var SbotApi = require('./sbot-api') | ||
16 | 7 … | ||
17 | -document.head.appendChild(h('style', require('./style.css.json'))) | ||
18 | - | ||
19 | -var modules = require('./modules') | ||
20 | - | ||
21 | -var u = require('./util') | ||
22 | - | ||
23 | -modules['sbot-api.js'] = SbotApi() | ||
24 | -combine(modules) | ||
25 | - | ||
26 | -if(process.title === 'node') { | ||
27 | - console.log(require('depject/graph')(modules)) | ||
28 | - process.exit(0) | ||
29 | -} | ||
30 | - | ||
31 | -document.body.appendChild(modules['app.js'].app()) | ||
32 | - | ||
33 | - |
Built with git-ssb-web