I’m working my way through Node for Front End devs, and as people on SO have already pointed out, Connect no longer has a module for routing. Some people have advised using Express, but I’m unsure of the exact syntax.
The example I am working through is hosted here:
github.com/garann/node-for-frontend-devs/blob/master/03-03.js
I would in turn like to finish the tutorial on templating:
js: github.com/garann/node-for-frontend-devs/blob/master/04-02.js
html: github.com/garann/node-for-frontend-devs/blob/master/public/parent.html
and was wondering whether people think it might be better to ditch these Connect based tutes and just learn how to use Express? As routing will most likely require Express anyway..
Thanks to SO excellent spam protection, I’ve had to remove the https:// portion of the github links.
Thanks for any help.
Try use this: https://github.com/baryshev/connect-route
UPDATE
In your project folder execute:
Updated code from your example:
Point your browser to:
http://[your_host_here]:8000/sayHello/nick/name