server-inspect-proxy
v1.0.6
Published
A node inspector proxy plugin
Downloads
1
Readme
server-inspect-proxy
Node inspect proxy, you can start remotely debugging with it.
Install
npm i server-inspect-proxy
or
yarn add server-inspect-proxy
Usage
You can define the inspection port and which will be automatically proxied.
NODE_OPTIONS=--inspect node ./index.js
node --inspect ./index.js
node --inspect --inspect-port=xxx ./index.js
// index.js
const { debug } = require('server-inspect-proxy')
const { createServer } = require('http')
const server = createServer((req, res) => {
res.statusCode = 200;
res.end("success");
}).listen(3320);
debug(server)
And open chrome://devtools/bundled/js_app.html?ws=YOUR_APP_HOST/__debug__
1.0.6
Use in koa/express:
const Koa = require('koa');
const app = new Koa();
const { debug } = require('../dist/index')
const main = ctx => {
ctx.response.body = 'Hello World';
};
app.use(main);
debug(app.listen(3322))