Split off server into own module

This commit is contained in:
Jef Roosens 2022-02-21 20:51:41 +01:00
parent 1d434db166
commit 92ad0c51eb
Signed by untrusted user: Jef Roosens
GPG key ID: 955C0660072F691F
6 changed files with 62 additions and 57 deletions

View file

@ -1,11 +0,0 @@
module main
import net.http
fn (mut app App) is_authorized() bool {
x_header := app.req.header.get_custom('X-Api-Key', http.HeaderQueryConfig{ exact: true }) or {
return false
}
return x_header.trim_space() == app.conf.api_key
}