mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Renamed all occurrences to Kemal
This commit is contained in:
parent
289ad42d4e
commit
5ca84fea4c
13 changed files with 38 additions and 38 deletions
22
src/kemal.cr
Normal file
22
src/kemal.cr
Normal file
|
@ -0,0 +1,22 @@
|
|||
require "option_parser"
|
||||
require "./Kemal/*"
|
||||
|
||||
at_exit do
|
||||
OptionParser.parse! do |opts|
|
||||
opts.on("-p ", "--port ", "port") do |opt_port|
|
||||
Kemal.config.port = opt_port.to_i
|
||||
end
|
||||
end
|
||||
|
||||
config = Kemal.config
|
||||
handlers = [] of HTTP::Handler
|
||||
handlers << HTTP::LogHandler.new
|
||||
handlers << Kemal::Handler::INSTANCE
|
||||
handlers << HTTP::StaticFileHandler.new("./public")
|
||||
server = HTTP::Server.new(config.port, handlers)
|
||||
|
||||
server.ssl = config.ssl
|
||||
|
||||
puts "Listening on #{config.scheme}://0.0.0.0:#{config.port}"
|
||||
server.listen
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue