crystal-gauntlet/src/template_endpoints/index.cr

14 lines
425 B
Crystal
Raw Normal View History

2023-01-03 19:28:38 +01:00
require "ecr"
include CrystalGauntlet
2023-01-05 17:53:12 +01:00
CrystalGauntlet.template_endpoints["/tools"] = ->(context : HTTP::Server::Context) {
context.response.headers.add("Location", "/")
context.response.status = HTTP::Status::TEMPORARY_REDIRECT
}
CrystalGauntlet.template_endpoints[""] = ->(context : HTTP::Server::Context) {
context.response.content_type = "text/html"
ECR.embed("./public/template/index.ecr", context.response)
2023-01-03 19:28:38 +01:00
}