0.1.0 • Published 11 years ago

connect-contribute v0.1.0

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

connect-contribute

Build Status

It's been suggested that one of the toughest parts of taking over maintenance of a website, especially one that represents a non-profit organization, is figuring out where to start. I propose two custom HTTP headers to help developers who would want to contribute to or report issues for a website.

This is a reference implementation as a Connect middleware for adding those headers to a Connect or Express.js website.

Usage

You can pass in the contribute and issues urls explicitly in the options for the contribute middleware.

var http    = require("http");
var connect = require("connect");
var contrib = require("connect-contribute");

var options = {
  contributeUrl: 'http://github.com/dustyburwell/kansascity2',
  issuesUrl: 'http://github.com/dustyburwell/kansascity2/issues',
};

var app = connect()
  .use(contrib(options))

http.createServer(app).listen(3000);

Or you can pass in the contents of your package.json file and so long as package.repository.url is filled in with a GitHub url and connect-contribute will convert it to a contriute url and an issues url.

var http    = require("http");
var connect = require("connect");
var contrib = require("connect-contribute");

var app = connect()
  .use(contrib(require("./package.json")))

http.createServer(app).listen(3000);