lib/rest-ftp-daemon/api/root.rb in rest-ftp-daemon-0.435.2 vs lib/rest-ftp-daemon/api/root.rb in rest-ftp-daemon-0.501.0
- old
+ new
@@ -29,11 +29,12 @@
Root.logger
end
def exception_error error, http_code, exception
# Extract message lines
- lines = exception.message.lines.collect(&:strip).reject(&:empty?)
+ lines = exception.message.lines
+ #.lines.collect(&:strip).reject(&:empty?)
# Log error to file
log_error "[#{error}] [#{http_code}] #{lines.shift} ", lines
# Return error
@@ -65,26 +66,26 @@
do_not_route_head!
do_not_route_options!
# version 'v1'
# Response formats
- content_type :json, 'application/json; charset=utf-8'
- # format :json
- default_format :json
+ #content_type :json, 'application/json; charset=utf-8'
+ format :json
+ # default_format :json
# Pretty JSON
# formatter :json_tmp, ->(object, env) do
# puts object.inspect
# JSON.pretty_generate(object)
# end
### MOUNTPOINTS
- mount RestFtpDaemon::API::Status => MOUNT_STATUS
- mount RestFtpDaemon::API::Jobs => MOUNT_JOBS
- mount RestFtpDaemon::API::Dashboard => MOUNT_BOARD
- mount RestFtpDaemon::API::Config => MOUNT_CONFIG
- mount RestFtpDaemon::API::Debug => MOUNT_DEBUG
+ mount API::Status => MOUNT_STATUS
+ mount API::Jobs => MOUNT_JOBS
+ mount API::Dashboard => MOUNT_BOARD
+ mount API::Config => MOUNT_CONFIG
+ mount API::Debug => MOUNT_DEBUG
### API Documentation
add_swagger_documentation hide_documentation_path: true,
api_version: Conf.app_ver,
@@ -107,6 +108,6 @@
redirect dashboard_url()
end
end
end
-end
+end
\ No newline at end of file