Git Product home page Git Product logo

nova-proxy's Introduction

Nova Proxy

Hypernova Proxy is an Reverse Proxy whick look in the hosts responses for Hypernova Directives in order to inject the components rendered by Hypernova Server.

Environment Variables

HYPERNOVA_BATCH=http://hypernova:3000/batch
CONFIG_FILE=config.json

Configuration File

Nova Proxy needs a configuration file:

//nova-proxy.json

{
  "locations": [
    {
      "path": "/",
      "host": "http://blog:8000",
      "modifyResponse": true
    }
  ]
}

The locations items require the path and host to let know to Nova Proxy which the application is responsible to serve the requested page. By default the path / passes all the requests to the declared host.

The modifyResponse enable the serve-side includes to that location.

Using Nova Proxy with Ara CLI

Before to run the command we need to set the HYPERNOVA_BATCH variable using the Nova service endpoint.

export HYPERNOVA_BATCH=http://localhost:3000/batch

The command uses a configuration file named nova-proxy.json in the folder where the command is running, otherwise you need to pass the --config parameter with a different path.

ara run:proxy --config ./nova-proxy.json

nova-proxy's People

Contributors

marconi1992 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nova-proxy's Issues

HTTPS support

It doesn't seem to be possible to use this proxy with a HTTPS/SSL host - is that correct?

Absence of meta injection

Hi Felipe,

It seems that the framework has not been updated since a while and might be deprecated. I've however taken back a projet that uses it and I wonder if you could help.

In the nova-cluster repo you have not release the branch which adds the meta field from its response, the one called "fix/missing-meta-nova-client". And same on this repo, the proxy neither intreprates nor uses the meta field that could be coming.

Reading this field and injecting it into the SSR HTML rendered from the main app as metatags would be really useful. It indeed could allow microfrontends to set part of the initial SSR call metatags for SEO purposes.

Deployment issues (need advice/examples)

I have the complete ara ecosystem running locally, but I'm having trouble getting nova proxy to run on Google App engine. I'm running the cluster and the proxy using the source code with the app engine go112 runtime. Again the cluster is running perfectly, but the proxy hangs and eventually fails with a 500. Everything works locally, and everything but the proxy works on app engine. Any help would be greatly appreciated.

Inject client scripts URLs from Hypernova response

Stack Overflow Question: https://stackoverflow.com/questions/61478514/is-there-a-way-to-have-the-client-side-script-also-auto-loaded-from-the-proxy-cl#

We should be able to return the client script URLs in the Hypernova response and inject the corresponding script tags when including the Nova views.

Example.

{
    "success": true,
    "error": null,
    "results": {
        "example": {
            "name": "Example",
            "html": "<div data-hypernova-key=\"Example\" data-hypernova-id=\"33719ec2-1b19-4023-8b2b-e82aa29990cc\"><h1 data-server-rendered=\"true\">Ara Framework</h1></div>\n<script type=\"application/json\" data-hypernova-key=\"Example\" data-hypernova-id=\"33719ec2-1b19-4023-8b2b-e82aa29990cc\"><!--{\"title\":\"Ara Framework\"}--></script>",
            "meta": {
                "src": "http://localhost:3000/public/client.js"
            },
            "duration": 0.36806,
            "statusCode": 200,
            "success": true,
            "error": null
        }
    }
}

Nova Proxy should include the next HTML element in the host page:

<script async src="http://localhost:3000/public/client.js" >

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.