Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

server-inspect-proxy

1.0.6 • Public • Published

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__

20200805005432

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))

Install

npm i server-inspect-proxy

DownloadsWeekly Downloads

7

Version

1.0.6

License

MIT

Unpacked Size

23.9 kB

Total Files

21

Last publish

Collaborators

  • avatar