Sha256: ef6e83cc1c6763258e5eb438a28e4e7a982b1717490de4bb5074f70e8987c7a8
Contents?: true
Size: 874 Bytes
Versions: 3
Compression:
Stored size: 874 Bytes
Contents
require_relative "lib/easycomments.rb" require_relative "lib/easycomments/ec_model.rb" class EC < Sinatra::Application include ECModel before do content_type 'application/json' end if ALLOW_CORS use Rack::Cors do allow do origins CORS_ORIGIN resource '/comments', :headers => :any, :methods => :get resource '/comment', :headers => :any, :methods => :post end end use Rack::Protection::FrameOptions use Rack::Protection::PathTraversal use Rack::Protection::IPSpoofing else use Rack::Protection::FrameOptions use Rack::Protection::PathTraversal use Rack::Protection::IPSpoofing use Rack::Protection::HttpOrigin end get "/comments" do get_comments(params[:post]) end post "/comment" do post_comment(params) end get "/" do redirect "/dashboard" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
easycomments-1.0.3 | ec.rb |
easycomments-1.0.2 | ec.rb |
easycomments-1.0.1 | ec.rb |