How do I fix connect.router?

科技动态 2018-06-18

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.

Node.js Recipes

责编内容by:Node.js Recipes (源链)。感谢您的支持!

您可能感兴趣的

网络安全无小事:特金会晤期间,新加坡爆发大规模网络攻击... 司空见惯,俄罗斯一直在对美国进行网络攻击,自2016年美国总统大选以来,美国对俄罗斯官员和企业实施了许多制裁措施。除官方制裁外,US-Cert...
Add a new Host and Services to be Monitored by Ici... In this tutorial, I will show you how to add a new host to be monitored by Icing...
Linux模拟路由器实验 实验目标: 将3台主机设置成路由器 实现两台终端能够相互通信 网络结构如下: 准备工作: 1、批量复制虚拟机文件,创建多个系统,提...
800,000 Virgin Media customer urged to change thei... Virgin Media, a leading provider of internet, TV, and phone services in Br...
Simplified Networking with a Wsky USB NIC I used to share an office with my wife. We both needed Internet connections, wit...