Class Favicon
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.service.Service
services.moleculer.web.middleware.HttpMiddleware
services.moleculer.web.middleware.Favicon
- All Implemented Interfaces:
services.moleculer.service.MoleculerLifecycle, HttpConstants
Server "/favicon.ico" HTTP requests. Sample:
route.use(new Favicon("custom.ico"));
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringRelative icon file path.protected StringRelative URL of the Favicon.protected byte[]protected intMax-age header's value (0 = no max-age header).protected booleanUse ETag headersFields inherited from class services.moleculer.service.MoleculerComponent
broker, logger, nameFields inherited from interface HttpConstants
ACCEPT, ACCEPT_ENCODING, AUTHORIZATION, CACHE_CONTROL, CHUNKED, CLOSE, CONNECT, CONNECTION, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, CONTENT_TYPE_HTML, CONTENT_TYPE_JSON, COOKIE, DEFLATE, DELETE, ETAG, GET, GZIP, HEAD, IF_NONE_MATCH, KEEP_ALIVE, LOCATION, META_CONTENT_TYPE, META_HEADERS, META_LOCALE, META_LOCATION, META_SESSION, META_STATUS, META_TEMPLATE, NO_CACHE, OPTIONS, PATCH, POST, PROPERTY_COOKIES, PROPERTY_SESSION_ID, PROPERTY_USER, PUT, SET_COOKIE, TRACE, TRANSFER_ENCODING, WWW_AUTHENTICATE, X_FORWARDED_FOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintinstall(RequestProcessor next, io.datatree.Tree config) booleanvoidsetIconPath(String iconPath) voidsetIconURL(String iconURL) voidsetMaxAge(int maxAge) voidsetUseETags(boolean useETags) Methods inherited from class services.moleculer.service.MoleculerComponent
getBroker, getLogger, getName, started, stopped
-
Field Details
-
iconPath
Relative icon file path. -
maxAge
protected int maxAgeMax-age header's value (0 = no max-age header). -
iconURL
Relative URL of the Favicon. -
useETags
protected boolean useETagsUse ETag headers -
image
protected byte[] image
-
-
Constructor Details
-
Favicon
public Favicon() -
Favicon
-
Favicon
-
-
Method Details
-
install
- Specified by:
installin classHttpMiddleware
-
getIconPath
-
setIconPath
-
getMaxAge
public int getMaxAge() -
setMaxAge
public void setMaxAge(int maxAge) -
getIconURL
-
setIconURL
-
isUseETags
public boolean isUseETags() -
setUseETags
public void setUseETags(boolean useETags)
-