All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.youi.app.TemplatePage.scala Maven / Gradle / Ivy

package io.youi.app

import io.youi.http.HttpConnection
import io.youi.http.content.Content

trait TemplatePage extends MatcherPage {
  def templateFor(path: String): Option[Content]

  def partFor(path: String): Option[Content]

  override protected def resource(httpConnection: HttpConnection): Option[Content] = {
    val path = httpConnection.request.url.path.decoded
    if (httpConnection.request.url.param("part").contains("true")) {
      partFor(path)
    } else {
      templateFor(path)
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy