Skip to content

Improves on express.js middleware for vhost by avoiding expensive regex chains. This will perform better and scale more than connect vhost.

Notifications You must be signed in to change notification settings

vast-engineering/express-vhost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-vhost

Improves on express.js middleware for vhost by avoiding expensive regex chains. This will perform better and scale more than connect vhost.

var evh = require('express-vhost'),
	express = require('express');

var appFactory = function(echo) {
	var app = express();
	app.get('/', function(req, res) {
		res.send(echo);
	});

	return app;
};

var server = express();
server.use(evh.vhost());
server.listen(port);

evh.register('test1-local', appFactory('test1'));
var app2 = appFactory('test2');
evh.register('test2-local', app2);
evh.register('*.test2-local', appFactory('test2'));

About

Improves on express.js middleware for vhost by avoiding expensive regex chains. This will perform better and scale more than connect vhost.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published