Class: Dsp::Api::V1::ConfigController

Inherits:
BaseController show all
Defined in:
app/controllers/dsp/api/v1/config_controller.rb

Instance Attribute Summary

Attributes inherited from BaseController

#env, #method, #path, #request

Instance Method Summary collapse

Methods inherited from BaseController

#initialize

Constructor Details

This class inherits a constructor from Dsp::Api::V1::BaseController

Instance Method Details

#createObject



11
12
13
14
15
16
# File 'app/controllers/dsp/api/v1/config_controller.rb', line 11

def create
  body = JSON.parse(request.body.read)
  validate_schema!(body, schema)
  Aho.config.update(body)
  respond({ status: 'OK', message: 'Configuration applied successfully' })
end

#indexObject



7
8
9
# File 'app/controllers/dsp/api/v1/config_controller.rb', line 7

def index
  respond(Aho.config.settings)
end