Class NotFound
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.service.Service
services.moleculer.web.middleware.HttpMiddleware
services.moleculer.web.middleware.NotFound
- All Implemented Interfaces:
services.moleculer.service.MoleculerLifecycle, HttpConstants
Refuses all requests with "Error 400 Not Found" message. Sample usage with
ServeStatic and Favicon middlewares:
route.use(new NotFound());
route.use(new ServeStatic("/", "/www"));
route.use(new Favicon("/www/images/custom.ico"));
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringTemplate of the HTML response.protected StringTemplate path of the HTML response.Fields 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 TypeMethodDescriptioninstall(RequestProcessor next, io.datatree.Tree config) voidsetHtmlTemplate(String htmlTemplate) voidsetHtmlTemplatePath(String htmlTemplatePath) Methods inherited from class services.moleculer.service.MoleculerComponent
getBroker, getLogger, getName, started, stopped
-
Field Details
-
htmlTemplatePath
Template path of the HTML response. -
htmlTemplate
Template of the HTML response.
-
-
Constructor Details
-
NotFound
public NotFound() -
NotFound
-
-
Method Details
-
install
- Specified by:
installin classHttpMiddleware
-
getHtmlTemplate
- Returns:
- the htmlTemplate
-
setHtmlTemplate
- Parameters:
htmlTemplate- the htmlTemplate to set
-
getHtmlTemplatePath
- Returns:
- the htmlTemplatePath
-
setHtmlTemplatePath
- Parameters:
htmlTemplatePath- the htmlTemplatePath to set
-