from app import app
import json
#from flask_cors import CORS
from flask import Flask, request, render_template, redirect, flash, url_for, jsonify
from sqlalchemy.exc import IntegrityError
import os

from .models import db, Recipe, Ingredient, MyRecipe, MyIngredient

@app.route('/')
def index():
    return render_template("/public/index.html")

@app.route("/signup")
def signup():
    return render_template("/public/signup.html")

@app.route('/test')
def test():
    data = Recipe.query.all()
    data = [recipe.toDict() for recipe in data]
    
    return json.dumps(data)
