1.3.1 • Published 1 year ago

service-version v1.3.1

Weekly downloads
130
License
Apache-2.0
Repository
github
Last release
1 year ago

Service-version

service-version

Overview

service-version provides a simple express/connect middleware for appending the project's version as an x-version header to all specified requests.

Usage

Just like above:

import serviceVersion from 'service-version';
import express from 'express';

const app = express();

app.use(serviceVersion());

Import the module and use it. It works with CJS require as well. This configuration will produce the following HTTP-Response-Header for all routes, if the package.json file has this version field:

{
  "version": "1.0.0"
}
HTTP/1.1 200 OK
X-Powered-By: Express
x-version: 1.0.0
Content-Type: application/json; charset=utf-8
Content-Length: 13
ETag: W/"d-jYIVkMttA3gZvYs6yuMWCdh78+w"
Date: Sat, 10 Mar 2018 17:53:25 GMT
Connection: keep-alive

(You can use curl to reproduce this log: curl http://localhost/ -I)

Have fun coding!

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

4 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago