Skip to content

An amazing tool for beating the Internet at its own game.

License

Notifications You must be signed in to change notification settings

m3talsmith/porter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Porter

Render HTML on the server and push it directly to a frontend element.

Installation

Install with npm

npm install --save porter-client

Install with bower

bower install --save porter

Usage

<html>
  <head>
    <title>It's Porter TIME!!!</title>
  </head>
  <body>
    <div id='main'>
      ..Main..
    </div>

    <script src="/js/porter.js"></script>
    <script src="/js/hook.js"></script>
    <script src="/js/connectors/ws_connector.js"></script>

    <script>
      var connector = new WsConnector("ws://localhost:8080/websocket")
      var hook = new Hook("main");
      var porter = new Porter(connector);
      porter.whitelist.add_rpc("hook.render", function(args) {
        hook.render(args);
      });

      porter.connect();
    </script>
  </body>
</html>

TODOS:

  • Make connectors optional and named.
  • Give connectors a kind array property.
  • Abstract Consumer.
  • Abstract Producer.

About

An amazing tool for beating the Internet at its own game.

Resources

License

Stars

Watchers

Forks

Packages

No packages published