How to use oc-empty-response-handler - 2 common examples

To help you get started, we’ve selected a few oc-empty-response-handler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opencomponents / oc / test / acceptance / registry.js View on Github external
it('should respond with a minimal empty view-model', () => {
        expect(result.data).to.eql({
          [emptyResponseHandler.viewModelEmptyKey]: true
        });
      });
    });
github opencomponents / oc / src / registry / routes / helpers / get-component.js View on Github external
);
                  cache.set('file-contents', cacheKey, template);
                  returnResult(template);
                }
              );
            }
          }
        };

        if (!component.oc.files.dataProvider) {
          returnComponent(null, {});
        } else {
          const cacheKey = `${component.name}/${component.version}/server.js`;
          const cached = cache.get('file-contents', cacheKey);
          const domain = Domain.create();
          const setEmptyResponse = emptyResponseHandler.contextDecorator(
            returnComponent
          );
          const contextObj = {
            acceptLanguage: acceptLanguageParser.parse(acceptLanguage),
            baseUrl: conf.baseUrl,
            env: conf.env,
            params,
            plugins: conf.plugins,
            renderComponent: nestedRenderer.renderComponent,
            renderComponents: nestedRenderer.renderComponents,
            requestHeaders: options.headers,
            setEmptyResponse,
            staticPath: repository
              .getStaticFilePath(component.name, component.version, '')
              .replace('https:', ''),
            setHeader: (header, value) => {

oc-empty-response-handler

Handler for the empty response use case

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis