0.3.0 • Published 9 years ago

@intactile/express-domain-middleware v0.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 years ago

express-domain-middleware

An express middleware providing domain informations

Build Status Code Climate Test Coverage

Install

npm install @intactile/express-domain-middleware

Usage

import express from 'express';
import domainMiddleware from '@intactile/express-domain-middleware';

const app = express();
app.use(domainMiddleware());
import { Router } from 'express';

const router = new Router();

router.post('/login/', (request, response, next) => {
  const domainInfo = request.domainInfo;
  console.log(domainInfo);
});

example :

domainInfo = { FQDN: 'app.brand.domain.com' // The Fully Qualified Domain Name
               domain : 'brand.domain.com', // The domain name
               host : 'domain.com' }        // The hostname