kore-doc

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

koreconf.md (1495B)



      1 # kore.conf
      2 
      3 The configuration file of an application describes to Kore what modules to load, how validators work, what page handlers to map to which functions and more.
      4 
      5 Therefore it is an integral part of Kore as a whole.
      6 
      7 # Server context
      8 
      9 A server context sets up a one or more listeners for the Kore server. These
     10 listeners can either be ipv4/ipv6 addresses or unix sockets.
     11 
     12 You can also turn off TLS in a server context by specifying the **tls no**
     13 option inside of a context.
     14 
     15 Example:
     16 
     17 ```
     18 server tls {
     19 	bind 127.0.0.1 443
     20 	bind ::1 443
     21 	unix /var/run/socket.path
     22 	unix @linux-abstract-socket
     23 }
     24 
     25 server notls {
     26 	bind 127.0.0.1 80
     27 	tls no
     28 }
     29 ```
     30 
     31 # Domain context
     32 
     33 A domain context attaches to a server context and defines any available
     34 routes inside of that domain and how they are routed.
     35 
     36 Example:
     37 
     38 ```
     39 domain kore.io {
     40 	attach tls
     41 
     42 	route / {
     43 		handler index
     44 		methods get
     45 	}
     46 }
     47 ```
     48 
     49 # Route context
     50 
     51 A route context is specified inside of a domain context and will tell Kore
     52 how to handle requests to the given route, what methods are allowed and
     53 how to validate any parameters for that route.
     54 
     55 Several different routing contexts can be given for the same path as long
     56 as the methods differ.
     57 
     58 Example:
     59 
     60 ```
     61 route / {
     62 	handler index
     63 	methods get
     64 }
     65 
     66 route / {
     67 	handler index_post
     68 	methods post
     69 	validate post username v_user
     70 }
     71 ```
     72 
     73 # Configuration options.
     74 
     75 Please see https://github.com/jorisvink/kore/blob/master/conf/kore.conf.example for all configuration options and what they do.