Movido proyecto a subdirectorio para acomodar el frontend aqui

This commit is contained in:
Daniel Cortes
2020-11-25 01:47:41 -03:00
parent c64b0edf1f
commit 3c177009d1
10 changed files with 0 additions and 0 deletions

30
backend/home/entry.py Normal file
View File

@@ -0,0 +1,30 @@
from flask import Flask, request
from flask_cors import CORS
from . import services
app = Flask(__name__)
app.config.from_object('home.settings')
CORS(app)
@app.route('/currency')
def currency():
base = request.args.get('base', 'CLP')
return services.currency.rates(base, app.config['FIXER_KEY'])
@app.route('/weather')
def weather():
city = request.args.get('city', 'temuco')
return services.weather.get(city, app.config['OPENWEATHERMAP_KEY'])
@app.route('/photos')
def photos():
page = request.args.get('page', 1)
return services.photos.get(app.config['UNSPLASH_KEY'], page)
@app.route('/quotes')
def quotes():
return services.quotes.get()
@app.route('/')
def hey():
return 'Hey, esta es la api men :c!'