public interface HotReload
extends io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
Usage: In your main HTML file add the following script at the end of the body.
<script src="/hot-reload/script" type="application/javascript"></script>
Once the server stops or reload the handler the script will force a page reload.
During the down time of the server the script will attempt to reconnect every second.
| Modifier and Type | Field and Description |
|---|---|
static io.vertx.core.logging.Logger |
LOGGER |
| Modifier and Type | Method and Description |
|---|---|
static HotReload |
create()
If the system property
hot.reload is true then it creates a HotReload Handler that will setup 2 endpoints: |
static HotReload |
create(boolean sse)
Creates a HotReload Handler that will setup 2 endpoints.
|
static io.vertx.ext.web.handler.StaticHandler |
createStaticHandler()
Creates a StaticHandler that will be configured to be non cached and point to the path src/main/resouces + webroot
|
static HotReload create()
hot.reload is true then it creates a HotReload Handler that will setup 2 endpoints:
/hot-reloadthe watch endpoint either a SSE or AJAX endpoint that returns the current deployment id
/hot-reload/scriptthe script to be added to the main HTML
By default it will use the SSE mode. Else this is a noop handler (pass through).
static HotReload create(boolean sse)
sse - if true then SSE will be used, otherwise AJAX.create()static io.vertx.ext.web.handler.StaticHandler createStaticHandler()
Copyright © 2017. All Rights Reserved.