express.io icon indicating copy to clipboard operation
express.io copied to clipboard

Support for Express.JS Router & Express.IO Routing

Open kylejeske opened this issue 10 years ago • 13 comments

Express Routing (implemented through mean.io stack):

app.route('/direction').get(direction.all).post(direction.create);
app.io.route('connection', function(req){
[...]
});

When attempting to use this, the router for express.io will override and not allow the original express.js routing Router.

I've attempting adding a prototype of Router to app without success too. Any suggestions?

kylejeske avatar May 28 '14 06:05 kylejeske

I have the same issue (up?)

leonprou avatar Jun 04 '14 12:06 leonprou

Same issue, anybody found a workaround ?

yannguillon avatar Jul 16 '14 22:07 yannguillon

Using everything just via app.VERB seems to be working fine for me. I'm not too familiar with Express but the docs seem to indicate you should be looking at app.routes rather than app.route.

Also, I think you might be trying to use a feature of Express 4.

narthur157 avatar Aug 06 '14 21:08 narthur157

Same issue! So confusing ...

krlicmuhamed avatar Aug 12 '14 15:08 krlicmuhamed

How can I use express.Router() in express.io

Danjavia avatar Nov 16 '14 20:11 Danjavia

Same issue... Docs mention the original routes should work. Doesn't seem to be the case.

TypeError: Property 'route' of object function app(req, res, next){ app.handle(req, res, next); } is not a function

I think narthur157 is right. I'm using express 4, just looked at the package.json and it's for "express": "~3.4.0",

jrsprice avatar Jan 07 '15 04:01 jrsprice

+1

also update the npm

sgarza avatar Jan 10 '15 20:01 sgarza

"How can I use express.Router() in express.io"

+1

garciaba avatar Jul 21 '15 09:07 garciaba

+1, require('express.io').Router() returns undefined with express 4.13.3 and express.io 1.1.13!

m4rcelofs avatar Sep 17 '15 19:09 m4rcelofs

+1

hmurtaza7 avatar Sep 27 '15 19:09 hmurtaza7

+1

dede-indrapurna avatar Oct 06 '15 04:10 dede-indrapurna

+1

alexchistyakov avatar Nov 08 '15 04:11 alexchistyakov

+1

docnoe avatar Nov 11 '15 16:11 docnoe