kore-doc

The kore documentation found under https://docs.kore.io/
Commits | Files | Refs | README | git clone https://git.kore.io/kore-doc.git

commit 858a8faf259fcf73d9bd87cd3c84aac310a65c09
parent 5baa4453b05f8b29ef4e04e151059ec8b26b5024
Author: Joris Vink <joris@coders.se>
Date:   Wed, 22 Sep 2021 17:53:15 +0200

add filemaps

Diffstat:
api/python.md | 40++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+), 0 deletions(-)

diff --git a/api/python.md b/api/python.md @@ -63,6 +63,7 @@ koreapp = MyApp() * [server](#server) * [domain](#domain) * [route](#domainroute) + * [filemaps](#filemaps) * [log](#log) * [timer](#timer) * [proc](#proc) @@ -372,6 +373,45 @@ koreapp = RouteExample() --- +# domain.filemaps {#filemaps} + +### Synopsis + +```python +domain.filemaps(dict) +``` + +### Description + +Add [https://docs.kore.io/4.1.0/applications/filemap.html](filemaps) to the domain. + +| Parameter | Description | +| --- | --- | +| maps | A dict containing the filemaps. The key is the URL part, the value is the local part on disk relative to the root of the worker process. | + +### Returns + +Nothing + +### Example + +```python +import kore + +class FileMap: + def configure(self, args): + kore.config.workers = 1 + kore.config.deployment = "dev" + + kore.server("default", ip="127.0.0.1", port="8888", tls=False) + dom = kore.domain("*", attach="default") + dom.filemaps({ "/": "webroot"}) + +koreapp = FileMap() +``` + +--- + # log {#log} ### Synopsis