How to use the oc.Client function in oc

To help you get started, we’ve selected a few oc 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-template-react / acceptance-setup / server.js View on Github external
module.exports = (port, cb) => {
  port = port || 4000;
  cb =
    cb ||
    function() {
      console.log("started");
    };

  const client = new oc.Client({
    registries: {
      clientRendering: "http://localhost:3000/",
      serverRendering: "http://localhost:3000/"
    }
  });

  return http
    .createServer(function(req, res) {
      const query = querystring.parse(url.parse(req.url).query);
      const components = [
        { name: "oc-client" },
        { name: "react-app", parameters: query }
      ];
      const options = {
        container: false,
        disableFailoverRendering: true,

oc

A framework for developing and distributing html components

MIT
Latest version published 27 days ago

Package Health Score

78 / 100
Full package analysis