foyer-dsi-assure-2035/api/src/lu/foyer/App.scala

23 lines
621 B
Scala
Raw Normal View History

2025-02-27 18:45:46 +01:00
package lu.foyer
2025-02-28 05:40:32 +01:00
import lu.foyer.clients.*
2025-02-27 18:45:46 +01:00
import zio.*
import zio.Console.*
import zio.http.*
import zio.http.codec.*
2025-02-28 05:40:32 +01:00
import zio.http.codec.PathCodec.path
import zio.http.endpoint.*
2025-02-27 18:45:46 +01:00
import zio.http.endpoint.openapi.OpenAPIGen
import zio.http.endpoint.openapi.SwaggerUI
2025-02-28 05:40:32 +01:00
import zio.schema.*
2025-02-27 18:45:46 +01:00
2025-02-28 05:40:32 +01:00
import java.net.URI
import java.time.LocalDate
import java.util.UUID
2025-02-27 18:45:46 +01:00
object App extends ZIOAppDefault:
2025-02-28 05:40:32 +01:00
val openAPI = OpenAPIGen.fromEndpoints(ClientController.endpoints)
val routes = ClientController.routes ++ SwaggerUI.routes("docs" / "openapi", openAPI)
2025-02-27 18:45:46 +01:00
override def run = Server.serve(routes).provide(Server.default)