-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbTest.js
More file actions
48 lines (45 loc) · 1.32 KB
/
dbTest.js
File metadata and controls
48 lines (45 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const db = require('./models')
// const axios = require('axios')
// require('dotenv').config()
// const EDAMAM_APP_ID = process.env.EDAMAM_APP_ID
// const EDAMAM_APP_KEY = process.env.EDAMAM_APP_KEY
// async function test() {
// try {
// const results = await axios.get(`https://api.edamam.com/search?q=ground chuck+tomatoes+potatoes+cheddar&app_id=${EDAMAM_APP_ID}&app_key=${EDAMAM_APP_KEY}`)
// console.log(results.data)
// } catch(error) {
// console.log(error)
// }
// }
// test()
// async function test() {
// try {
// const user = await db.user.findOne({
// where: {
// id: 1
// },
// include: [db.recipe, db.review]
// })
// console.log(user)
// } catch (error) {
// console.log(error)
// }
// }
// test()
// console.log(db)
// async function test() {
// try {
// const recipe = await db.recipe.findOne({where: { id: 1 }})
// const user = await db.user.findOne({where: {id: 1}})
// const review = await db.review.create({
// rating: 3,
// content: "this sucks",
// recipeId: recipe.id,
// userId: user.id
// })
// console.log(user)
// } catch (error) {
// console.log(error)
// }
// }
// test()