peers / peerjs-server

Server for PeerJS
https://peerjs.com
MIT License
4.37k stars 1.09k forks source link

Allow mounting into express.js application #36

Closed halfdan closed 10 years ago

halfdan commented 10 years ago

The PeerJS server is definitely a nice piece of software, but it would be great if it could be mounted into an existing express.js application. This would allow people to build more advanced applications around the server.

bachwehbi commented 10 years ago

Plus 1 for this ticket I definitely Agree with halfdan's comment.

floatdrop commented 10 years ago

I think PeerServer should extend restify object to enable this feature (instead of keeping it in this._app. Also this will allow export application object to grunt-express-server.

floatdrop commented 10 years ago

After some searching around - turns out, that restify can't be used with express.

bergie commented 10 years ago

@floatdrop there is express-resource which should allow doing similar things as restify with Express

floatdrop commented 10 years ago

@bergie yes, there is. I would write a pull-request to migrate from restify to express, but I don't know about repo owners thoughts on it.

halfdan commented 10 years ago

I'm very positive on moving from restify to express!

michelle commented 10 years ago

As I mentioned in a separate thread, we actually switched FROM express to restify. Happy to consider switching back.

Michelle

On Thu, Apr 3, 2014 at 7:27 AM, Fabian Becker notifications@github.comwrote:

I'm very positive on moving from restify to express!

— Reply to this email directly or view it on GitHubhttps://github.com/peers/peerjs-server/issues/36#issuecomment-39457213 .

RangerMauve commented 10 years ago

Any progress on this? Maybe allowing the PeerJS server to be mounted on just a regular HTTP Server instance?

guilleliss commented 10 years ago

Looking forward for this too !

jimmywarting commented 10 years ago

Can't wait :+1:

michelle commented 10 years ago

Sorry for the delay on this--I'll try to get out an expressjs peer server this weekend.

minicuper commented 10 years ago

To fix request.query for expressjs I use this express workaround:

expressApp.use(function(req, res, next){
  req.query = null;
  next();
})

the middlware should be first in express.

minicuper commented 10 years ago

Hi, how's it going with migration?