Sha256: d9134ef506dff47bf18af8f554ac9948343bad34a84189afd1953064ccd7bb22
Contents?: true
Size: 607 Bytes
Versions: 14
Compression:
Stored size: 607 Bytes
Contents
# frozen_string_literal: true module Waylon module Services # A Ping Service for monitoring class Ping < Sinatra::Base configure do set :protection, except: :http_origin set :logging, ::Waylon::Logger end before do content_type "application/json" halt 403 unless request.get? || request.options? end after do headers "Access-Control-Allow-Methods" => %w[OPTIONS GET] if request.options? end get "/" do { status: :ok }.to_json end options "/" do halt 200 end end end end
Version data entries
14 entries across 14 versions & 1 rubygems