Add the application's current git sha as a response header
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
Makefile
README.md
index.js
package.json
test.js

README.md

connect-gitsha

Add an 'X-Git-SHA' header to each response

Build Status

installation

$ npm install connect-gitsha

usage

Like any other middleware:

var express = require('express')
  , gitsha  = require('connect-gitsha')
;

var app = express();

app.use(gitsha());

Why?

Because it's nice to know what rev of your software is running

requirements

  1. git needs to be in the path of the application user
  2. the working directory needs to be within the git repository