mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-04 00:00:51 -04:00
- initial commit
This commit is contained in:
25
src/mango.cr
Normal file
25
src/mango.cr
Normal file
@@ -0,0 +1,25 @@
|
||||
require "kemal"
|
||||
require "./config"
|
||||
require "./library"
|
||||
require "./storage"
|
||||
require "./auth_handler"
|
||||
|
||||
config = Config.load
|
||||
|
||||
library = Library.new config.library_path
|
||||
|
||||
storage = Storage.new config.db_path
|
||||
|
||||
get "/" do
|
||||
"Hello World!"
|
||||
end
|
||||
|
||||
# APIs
|
||||
get "/api/test" do |env|
|
||||
"Hello!"
|
||||
end
|
||||
|
||||
add_handler AuthHandler.new
|
||||
|
||||
Kemal.config.port = config.port
|
||||
Kemal.run
|
||||
Reference in New Issue
Block a user