Skip to content

Instantly share code, notes, and snippets.

View serv's full-sized avatar
slow and steady wins the race - jeb

Jason Kim serv

slow and steady wins the race - jeb
View GitHub Profile
serv /
Created December 3, 2015 20:54 — forked from lolpack/
Null Response Server
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
#This class will handles any incoming request from
#the browser
class myHandler(BaseHTTPRequestHandler):
#Handler for the GET requests
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'