abagshaw abagshaw - 1 year ago 73
Node.js Question

expressjs get sections of url between slashes

If I setup a simple server using express for node.js listening on port

as follows:

app.get('/*', function (req, res) {

Imagine I trigger this function by going to

How could I get the sections of the url between the slashes and put them in some format (array of strings). So I can get
["first", "second", "third"]


Answer Source

Some another letters to minimal 30 symbols.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download