0.1.5 • Published 11 years ago

kubrick v0.1.5

Weekly downloads
1
License
MIT
Repository
github
Last release
11 years ago

Kubrick

A standalone NodeJS redirect server. Middleware planned for Express and Koa. This should be considered a work-in-progress.

Usage

Standalone

Pass the constructor a string containing a fallback URL and bind to a port

kubrick('http://kubrickjs.com').listen(80);

Pass an array of redirect objects to the constructor and bind to a port

kubrick('http://kubrickjs.com', [
	{
		pattern : '/',
		target : '/home'
	}, {
		pattern : '/old',
		target : '/new'
	}
]).listen(80);

Pass an object to the constructor with optional fallback and array of redirects then bind to a port

kubrick({
	fallback : 'http://kubrickjs.com',
	redirects : [
		{
			pattern : '/',
			target : '/home'
		}, {
			pattern : '/old',
			target : '/new'
		}
	]
}).listen(80);

Pass an object to the constructor with optional fallback and array of redirects then bind to a port

kubrick({
	fallback : 'http://kubrickjs.com',
	hosts : {
		'localhost' : [
			{
				pattern : '/',
				target : '/home'
			}, {
				pattern : '/old',
				target : '/new'
			}
		],
		'www.google.com' : [
			{
				pattern : '/',
				target : 'http://google.com'
			}, {
				pattern : '/old',
				target : '/new'
			}
		]
	}
}).listen(80);

Releases

0.1 - Initial version

  • Constructor
  • Load
  • Listen method
  • Static redirects

Roadmap

0.2 - Tests

0.3 - Strict redirects, Wildcard redirects

0.4 - Listen securely

0.5 - Regex redirects, Internal redirects

0.6 - Express & Koa middleware

0.7 - Middleware prefix

0.8 - Koa middleware

0.9 - Fixes

1.0 - Gold

Tests

Make sure you have the mocha testing framework installed globally

$ npm install -g mocha

Then run mocha:

$ mocha
0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago