Switched to cli module; merged cli & vieter into single binary

This commit is contained in:
Jef Roosens 2022-04-06 16:52:31 +02:00
parent 09d0a40aae
commit 5b919ceeae
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
9 changed files with 167 additions and 65 deletions

View file

@ -6,6 +6,7 @@ import log
import repo
import env
import util
import cli
const port = 8000
@ -20,9 +21,7 @@ pub mut:
}
// server starts the web server & starts listening for requests
pub fn server() ? {
conf := env.load<env.ServerConfig>() ?
pub fn server(conf env.ServerConfig) ? {
// Configure logger
log_level := log.level_from_tag(conf.log_level) or {
util.exit_with_message(1, 'Invalid log level. The allowed values are FATAL, ERROR, WARN, INFO & DEBUG.')