Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Express plugin for convenient aliases (redirects).

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 README.md
Octocat-spinner-32 example.js
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
Octocat-spinner-32 test.js
README.md

Travis build status

Express-Alias

Adds a convenience app.alias() method to Express for aliasing redirect routes.

Supports both Express 2 and Express 3.

Example

// uses Express's default redirect status (currently 302):
app.alias('/privacy', '/privacy-policy');
app.alias('/terms', '/terms-of-service');

// but you can explicitly specify a status as well:
app.alias('/aseem', '/aseemk', 301);

Installation

npm install express-alias

Usage

You can either require() Express normally and then extend it:

var express = require('express');
require('express-alias');

Or just require() this module, which returns the extended Express for convenience:

var express = require('express-alias');

TODO

Support route parameters (e.g. '/user/:id''/users/:id').

License

MIT. © 2012 Aseem Kishore.

Credits

TJ Holowaychuk for the awesome Express.

Something went wrong with that request. Please try again.