| Age | Commit message (Collapse) | Author |
|
At this point, all of the fields in the struct ServeOptions is the
same with [lib/http.ServerOptions] except IsDevelopment and
ConvertOptions.
For field IsDevelopment we keep in the struct.
For field ConvertOptions we remove it and let the caller pass it on
Serve function or InitHTTPServer method.
|
|
The field Listener allow passing [net.Listener] instance for accepting
HTTP connection.
One of the use case is to activate the ciigo serve using systemd.socket(5).
|
|
If the requested path is directory and no "index.html" file exist in
that directory, ciigo server will render list of files as "index.html"
automatically.
|
|
|
|
|
|
While at it, replace any use of ioutil with os/io package.
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
If the IsDevelopment option set to true, the serve function will serve
the root directory directly and watch all asciidoc files for changes
and convert it.
This is like running Watch, Convert and Serve at the same time.
|
|
The ConvertOptions now has the Exclude field that can contains regular
expression. If the Exclude is not empty, it will be compiled and use
in Convert, Generate, Watch, and Serve; to ignore specific paths
being scanned.
|
|
Previously, we pass four parameters to Serve function: the instance
to memfs.MemFS, the root directory, the address to listen, and
path to HTML template.
In case we need to add new parameter in the future, the Serve function
signature will changes and this is not good for consumer of API.
This commit changes the Serve function parameters to ServeOptions
so we can add optional parameter in the future without changes to its
signature.
|