Skip to content

Commit

Permalink
browser: add debug page.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Jul 17, 2017
1 parent 8451fab commit f4f5abe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions browser/debug.html
Original file line number Diff line number Diff line change
@@ -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>
7 changes: 6 additions & 1 deletion browser/server.js
Original file line number Diff line number Diff line change
@@ -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`);
Expand Down Expand Up @@ -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');
});
Expand Down

0 comments on commit f4f5abe

Please sign in to comment.