browser: add debug page.

This commit is contained in:
Christopher Jeffrey 2017-07-06 22:39:00 -07:00
parent 8451fab965
commit f4f5abefef
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 17 additions and 1 deletions

11
browser/debug.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>bcoin</title>
<script src="/bcoin.js"></script>
</head>
<body>
<h1>Bcoin</h1>
<p>Use the console to access `global.bcoin`.</p>
</body>
</html>

View File

@ -1,11 +1,12 @@
'use strict';
const fs = require('fs');
const HTTPBase = require('../lib/http/base');
const WSProxy = require('./wsproxy');
const fs = require('fs');
const index = fs.readFileSync(`${__dirname}/index.html`);
const indexjs = fs.readFileSync(`${__dirname}/index.js`);
const debug = fs.readFileSync(`${__dirname}/debug.html`);
const bcoin = fs.readFileSync(`${__dirname}/bcoin.js`);
const master = fs.readFileSync(`${__dirname}/bcoin-master.js`);
const worker = fs.readFileSync(`${__dirname}/bcoin-worker.js`);
@ -40,6 +41,10 @@ server.get('/index.js', (req, res) => {
res.send(200, indexjs, 'js');
});
server.get('/debug', (req, res) => {
res.send(200, debug, 'html');
});
server.get('/bcoin.js', (req, res) => {
res.send(200, bcoin, 'js');
});