UNPKG

hirefire-resource

Version:

HireFire integration library for Node.js applications

20 lines (16 loc) 432 B
const { RequestInfo, request } = require("../middleware") async function HireFireMiddlewareExpress(req, res, next) { const response = await request( new RequestInfo( req.path, req.get("X-Request-Start"), req.get("HireFire-Token"), ), ) if (response) { res.status(response.status).set(response.headers).json(response.body) } else { next() } } module.exports = HireFireMiddlewareExpress