Open Source API Gateway
9. Misc

webServer

Version

Serves static files from a directory, a classpath location, or a URL, based on the request's path. The interceptor chain does not continue past this interceptor: it always finalizes the exchange, either with the contents of a matching file or with an error response, 404 for a path that matches no file and 400 for one that tries to escape the document base.

Example Configuration

api:
port: 2000
flow:
- webServer:
docBase: docBase
index: index.html
api:
   port: 2000
   flow:
     - webServer:
         docBase: docBase
         index: index.html

Syntax

webServer:
docBase: <string> # required
generateIndex: <boolean>
index: <string>
webServer:
  docBase: <string> # required
  generateIndex: <boolean>
  index: <string>

Attributes

NameRequiredDefaultDescriptionExamples
docBasetruedocBaseSets path to the directory that contains the web content.docBase
generateIndexfalse-Whether to generate an HTML directory listing when a requested directory has no matching index file.-
indexfalse-Comma-separated list of file names tried, in order, when a request resolves to a directory rather than a file.-

Can be used in