Which Node.js Router Should I Use?

Lupus picture Lupus · Feb 8, 2012 · Viewed 21k times · Source

I want to develop a CMS and I need a good routing system for Node.js.

I don't have any predecisions and I'm open any advice.

Answer

Raynos picture Raynos · Feb 8, 2012

Express

express has a rock solid router build into it. It's got a lovely DSL syntax

router.get("/foo/:id/:item", function (req, res) {
    console.log(req.params.id);
});

Director

Director is an awesome standalone router that is part of Flatiron

router.get(/hola/, helloWorld)

Your own

For a lightweight codebase spinning up your own router using regular expressions is really easy