# Embedded Web Server

Ws4sqlite embeds a web server for static resources. This may be useful if you want to call it from a web page, to serve it on the same port as ws4sqlite itself, thus avoiding the need for CORS configurations.

To activate it, specify the `--serve-dir` commandline switch, with the directory to serve. The contents of that directory will be served under the "`/`" virtual path (i.e. the root), with the GET method. Of course, the specified directory must exist.

{% hint style="info" %}
The connections to the database(s) are served as POST, so there's no overlap.
{% endhint %}

The web server is configured with the following capabilities:

| Feature             |              |
| ------------------- | ------------ |
| Default resource    | `index.html` |
| Byte range requests | Enabled      |
| Dir. navigation     | Disabled     |
| Compression         | Disabled     |
| Max age             | Disabled     |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://germ.gitbook.io/ws4sqlite/documentation/web-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
