/
Main.scala
35 lines (26 loc) · 940 Bytes
/
Main.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Copyright © 2021 - 2022 Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors.
* SPDX-License-Identifier: Apache-2.0
*/
package org.knora.webapi
import zio._
import zio.logging.backend.SLF4J
import org.knora.webapi.core._
object Main extends ZIOApp {
override def environmentTag: EnvironmentTag[Environment] = EnvironmentTag[Environment]
/**
* The `Environment` that we require to exist at startup.
*/
override type Environment = LayersLive.DspEnvironmentLive
/**
* `Bootstrap` will ensure that everything is instantiated when the Runtime is created
* and cleaned up when the Runtime is shutdown.
*/
override def bootstrap: ZLayer[
ZIOAppArgs,
Any,
Environment
] = ZLayer.empty ++ Runtime.removeDefaultLoggers ++ SLF4J.slf4j ++ LayersLive.dspLayersLive
/* Here we start our Application */
override def run = AppServer.live.launch
}