Interface StaticContent

All Superinterfaces:
JexExtension, JexPlugin

public sealed interface StaticContent extends JexPlugin
Static content resource handler.

 var staticContent = StaticContent.createFile("src/test/resources/public")
    .directoryIndex("index.html")
    .preCompress()
    .build()

 Jex.create()
   .plugin(staticContent)
   .port(8080)
   .start();

  • Method Details

    • ofClassPath

      static StaticContent.Builder ofClassPath(String resourceRoot)
      Create and return a new static content class path configuration.
      Parameters:
      resourceRoot - The file to serve, or the directory the files are located in.
    • ofClassPath

      static StaticContent.Builder ofClassPath()
      Create and return a new static content class path configuration with the `/public` directory as the root.
    • ofFile

      static StaticContent.Builder ofFile(String resourceRoot)
      Create and return a new static content configuration for a File.
      Parameters:
      resourceRoot - The path of the file to serve, or the directory the files are located in.