Class

eu.akkamo.web

WebContentModule

Related Doc: package web

Permalink

class WebContentModule extends Module with Initializable with Runnable

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
      }
   ]
}
Linear Supertypes
Runnable, Initializable, Module, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WebContentModule
  2. Runnable
  3. Initializable
  4. Module
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WebContentModule()

    Permalink

Type Members

  1. case class DefaultWebContentRegistry(aliases: List[String], routeRegistryAlias: Option[String], default: Boolean, mapping: Map[String, RouteGenerator] = Map.empty) extends WebContentRegistry with Product with Serializable

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val RouteRegistryAlias: String

    Permalink
  5. val WebContentModuleKey: String

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def dependencies(dependencies: Dependency): Dependency

    Permalink
    Definition Classes
    WebContentModule → Module
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. def iKey(): Class[_ <: Initializable]

    Permalink
    Definition Classes
    Initializable
  15. def initialize(ctx: Context): Res[Context]

    Permalink
    Definition Classes
    WebContentModule → Initializable
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def rKey(): Class[_ <: Runnable]

    Permalink
    Definition Classes
    Runnable
  21. def run(ctx: Context): Res[Context]

    Permalink
    Definition Classes
    WebContentModule → Runnable
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    Module → AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Runnable

Inherited from Initializable

Inherited from Module

Inherited from AnyRef

Inherited from Any

Ungrouped