Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Express recursive route matching can overflow stack
var express = require("express");
var app = express();
var TOO_MANY = 8000;
function handler(req, res) {
// test higher routes, eventually you will get
// RangeError: Maximum call stack size exceeded
for (var i = 0; i < TOO_MANY; i++) {
app.get('/' + i, handler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.