Package

eu.akkamo

web

Permalink

package web

Visibility
  1. Public
  2. All

Type Members

  1. class FileFromDirGenerator extends RouteGenerator

    Permalink

  2. class WebContentModule extends Module with Initializable with Runnable

    Permalink

    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):

    default = {
      routeRegistryAlias="akkamo.webContent"
      default = true
      routeGenerators = [
          {
            class = eu.akkamo.web.FileFromDirGenerator
          }
       ]
    }
  3. trait WebContentRegistry extends Registry[ContentMapping]

    Permalink

    Represents registry for single configured static content mapping.

Value Members

  1. object FileFromDirGenerator

    Permalink
  2. object WebContentRegistry

    Permalink

Ungrouped