Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/vmpooler/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Vmpooler
class API < Sinatra::Base
# Load API components
%w[helpers dashboard v3 request_logger healthcheck].each do |lib|
%w[helpers dashboard v3 request_logger healthcheck rate_limiter].each do |lib|
require "vmpooler/api/#{lib}"
end
# Load dashboard components
Expand Down Expand Up @@ -50,6 +50,9 @@ def self.execute(torun, config, redis, metrics, logger)
# Enable API request logging only if required
use Vmpooler::API::RequestLogger, logger: logger if config[:config]['request_logger']

# Enable rate limiting if configured
use Vmpooler::API::RateLimiter, redis, config if config[:config]['rate_limiting_enabled']

use Vmpooler::Dashboard
use Vmpooler::API::Dashboard
use Vmpooler::API::V3
Expand Down
Loading