package de.arindy.dicetower

import io.quarkus.qute.TemplateInstance
import jakarta.enterprise.context.ApplicationScoped
import jakarta.ws.rs.GET
import jakarta.ws.rs.Path
import jakarta.ws.rs.Produces
import jakarta.ws.rs.core.MediaType
import org.eclipse.microprofile.config.inject.ConfigProperty

@Path("/")
@ApplicationScoped
final class IndexResource() {

    @ConfigProperty(name = "quarkus.application.version")
    private lateinit var version: String

    @GET
    @Produces(MediaType.TEXT_HTML)
    fun get(): TemplateInstance {
        return Templates.index(version)
    }

}
