I'm trying to profile a simple express application. When I run node it responds with
throw new Error('Cannot find stack');
^
Error: Cannot find stack
Here's the code
var express = require("express");
var app = express();
require('express-debug')(app, {});
app.get("/", function(request, response) {
response.send("Hello world!");
});
app.get("/other", function(request, response) {
var message = "";
for(var ii = 0; ii < 10000; ++ii) {
message = message + "x";
}
response.send(message);
});
app.listen(3000);
To solve your problem you must call express-debug after your routes, for example:
var express = require("express");
var app = express();
var debug = require('express-debug')
app.get("/", function(request, response) {
response.send("Hello world!");
});
app.get("/other", function(request, response) {
var message = "";
for(var ii = 0; ii < 10000; ++ii) {
message = message + "x";
}
response.send(message);
});
debug(app, {});
app.listen(3000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With