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

    • createCP

      static StaticContent.Builder createCP(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.
    • createCP

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

      static StaticContent.Builder createFile(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.