mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
added configure serve_static
This commit is contained in:
parent
0f609f6718
commit
ed769ad700
3 changed files with 21 additions and 8 deletions
|
@ -4,9 +4,7 @@ require "./kemal/middleware/*"
|
|||
at_exit do
|
||||
Kemal::CLI.new
|
||||
config = Kemal.config
|
||||
config.setup_logging
|
||||
config.setup_error_handler
|
||||
config.add_handler Kemal::StaticFileHandler.new(config.public_folder)
|
||||
config.setup
|
||||
config.add_handler Kemal::RouteHandler::INSTANCE
|
||||
|
||||
server = HTTP::Server.new(config.host_binding.not_nil!.to_slice, config.port, config.handlers)
|
||||
|
@ -30,7 +28,7 @@ at_exit do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
config.logger.write "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}\n"
|
||||
server.listen
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue