Inject REPL into connect/express as middleware.
Middleware is loaded only in environment other than production
Following is exported into REPL:
last_req
-- last request objectlast_res
-- last response objectstop
-- boolean. Set to true if you want "set breakpoint" in next requestnext
-- function. Call if you want to continue afterstop
requestreq
-- current request object when stoppedres
-- current response object when stopped
Module exports global function REPL_EXPORT(name, value)
which can be called anywhere.
Provided value is accesible by name
in REPL.
var express = require('express');
var app = express();
// ...
app.use(require('connect-repl')());
// some routes...
app.listen(3000);