Created
December 11, 2016 22:40
-
-
Save alcidesjunior/70dcd7d5e974f2ce266720451cbfa461 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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