Sha256: 76cd4408d9d5a9d7d4f186c7eecb39e2d3a628c01f5c7ef70257213e69e2451b

Contents?: true

Size: 472 Bytes

Versions: 2

Compression:

Stored size: 472 Bytes

Contents

class BrandsHandler < BaseHandler
    def mount
        @server.mount_proc('/brands.json') do |req, res|
            begin
                brands_list = BrandsManager.instance.brands_list
                json = JSON.generate(brands_list)
                res.body = json
                res['Content-Type'] = 'application/json'
            rescue StandardError => e
                handle_error(res, e, "Error fetching brands list")
            end
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solara-0.2.0 solara/lib/core/dashboard/handler/brands_handler.rb
solara-0.1.0 solara/lib/core/dashboard/handler/brands_handler.rb