Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/graphql / dist / deps / proxyCache.js
Size: Mime:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function createProxyCacheMiddleware(proxyConfig) {
    /**
     * @inheritdoc
     * @description wraps api requests to use our cache > backend one
     * @type {Express.middleware}
     * @listens /api
     */
    function proxyWrap(req, res, next) {
        const hash = fromRequestToHash(res, '/apiproxy/');
        console.log('[uxui-apis] REQUESTING_STREAM: ', '\n' + proxyConfig.target + '\n\n');
        console.log(proxyConfig);
        // if (oneStorage.has(hash) && nocache(req) === false) {
        //   // console.log('node cached')
        //   // require('fliplog').cyan('yay! cached!').data(hash).echo()
        //   res.send(oneStorage.get(hash))
        // } else {
        //   // console.log('node uncached')
        //   // require('fliplog').yellow('sadness! uncached!').data(hash).echo()
        //   next()
        // }
        // return undefined
    }
    // if (DISABLE_CUSTOM_PROXY_CACHE === true) {
    // api.use(route, proxyWrap)
    return proxyWrap;
}
exports.createProxyCacheMiddleware = createProxyCacheMiddleware;
//# sourceMappingURL=proxyCache.js.map