Sha256: 0955ee8ff29514a90ef670d5be45ea68762cc183a1fe6a5cec7313bc15cf2b20
Contents?: true
Size: 475 Bytes
Versions: 19
Compression:
Stored size: 475 Bytes
Contents
module Endpoints class Schema < Base get "/schema.json" do content_type "application/schema+json" headers["Cache-Control"] = "public, max-age=3600" unless File.exists?(schema_filename) message = "This application does not have a schema file." raise Pliny::Errors::NotFound.new(message) end File.read(schema_filename) end private def schema_filename "#{Config.root}/schema/schema.json" end end end
Version data entries
19 entries across 19 versions & 1 rubygems