Skip to content

Instantly share code, notes, and snippets.

@alcidesjunior
Created December 11, 2016 22:40
Show Gist options
  • Save alcidesjunior/70dcd7d5e974f2ce266720451cbfa461 to your computer and use it in GitHub Desktop.
Save alcidesjunior/70dcd7d5e974f2ce266720451cbfa461 to your computer and use it in GitHub Desktop.
from bottle import auth_basic,run, request, response,HTTPResponse,Bottle
import json,md5,time
from dbase import database as db
app = Bottle()
@app.hook('before_request')
def enable_cors():
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'PUT, GET, POST, DELETE, OPTIONS'
response.headers['Access-Control-Allow-Headers'] = 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
@app.post('/login')
def logar():
loginJSON = request.json
email = loginJSON['email']
pss = loginJSON['password']
print "email"
print email
print pss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment