Sha256: b734edd03058e142ffd939f3ac3991c095090f1e2bdfadb8b7ffb30424011846
Contents?: true
Size: 1.52 KB
Versions: 2
Compression:
Stored size: 1.52 KB
Contents
# encoding: utf-8 module Mutx module Routes module Api class Routes < App define do begin on('input') { run Api::Input::Routes } on('repositories') { run Api::Repositories::Routes } on('git') { run Api::Git::Routes } on('results') { run Api::Results::Routes } on('tasks') { run Api::Tasks::Routes } on('tests') { run Api::Tasks::Routes } on('custom/params') { run Api::CustomParams::Routes } on get do on "version" do output = { "version" => Mutx::VERSION} res.write output.to_json end on "error" do query_string = Mutx::Support::QueryString.new req output = Mutx::API::Error.show(query_string) res.write output.to_json end on root do response = {"message" => "Please, refer to /help/api for more information"} res.write response.to_json end end rescue => exception Mutx::Support::Log.error "Cuba: #{exception} #{exception.backtrace}" if Mutx::Support::Log error_title , error_msg = Mutx::Support::ErrorHandlerHelper.evaluate exception response = { error_title: error_title, error_msg: error_msg }.to_json res.write response end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mutx-0.2.9 | lib/mutx/routes/api_routes.rb |
mutx-0.2.8 | lib/mutx/routes/api_routes.rb |