classWebContentModule extends Module with Initializable with Runnable
Akkamo module allowing to serve static content either from the classpath resource or
selected directory.
Akkamo module allowing to serve static content either from the classpath resource or
selected directory. The ways how to serve the static content can be extended at runtime by
plugging in custom implementation of WebContentRegistry, or implementing custom
WebContentRegistry.RouteGenerator (see routeGenerators section in example documentation
below or FileFromDirGenerator example implementation).
Configuration example
akkamo.webContent = {
// empty WebContentRegistryCreated// RouteGenerators must be added manualy
name1 = {
routeRegistryAlias = "akkaHttpAlias"
aliases = ["alias1", "alias2"]
},
// WebContentRegistryCreated containing one// RouteGenerator serving content of web directory and listening on .../web
name2 = {
default = true// at least in one configuration is value mandatory if the number of instances is > 1
routeGenerators = [
{
prefix="web"class = eu.akkamo.web.FileFromDirGenerator
parameters = ["/web"]
}
]
}
}
If no configuration is provided, default configuration equivalent to configuration snipped
below is used, trying to serve the static content from /web directory, either found at
classpath or file system (see FileFromDirGenerator for more details):
Akkamo module allowing to serve static content either from the classpath resource or selected directory. The ways how to serve the static content can be extended at runtime by plugging in custom implementation of WebContentRegistry, or implementing custom WebContentRegistry.RouteGenerator (see
routeGenerators
section in example documentation below or FileFromDirGenerator example implementation).Configuration example
If no configuration is provided, default configuration equivalent to configuration snipped below is used, trying to serve the static content from
/web
directory, either found at classpath or file system (see FileFromDirGenerator for more details):