-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Valerie MacDougall
authored and
Valerie MacDougall
committed
Mar 6, 2018
0 parents
commit c6252d8
Showing
23 changed files
with
14,923 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
key.js | ||
|
||
# dependencies | ||
/node_modules |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const express = require('express') | ||
const app = express() | ||
const axios = require('axios') | ||
const key = require('../key.js'); | ||
const bodyParser = require('body-parser') | ||
const cors=require('cors') | ||
let lcboKey = key.key; | ||
let trial = [] | ||
|
||
app.use(bodyParser.urlencoded({extended:false})) | ||
app.use(bodyParser.json()) | ||
app.use(cors()) | ||
|
||
axios.get(`http://lcboapi.com/products?q=red+wine&store_id=511&where=is_vqa&access_key=${lcboKey}`).then((result) => { | ||
//console.log('success' + JSON.stringify(result.data.result)) | ||
let winelist = [] | ||
let data = result.data.result; | ||
for (i = 0; i < data.length; i++) { | ||
if (data[i].primary_category === "Wine") { | ||
winelist.push(data[i]); | ||
} | ||
} | ||
// console.log(winelist); | ||
}).catch((err) => { | ||
console.log('got an error' + err) | ||
}) | ||
|
||
app.post('/wine',(req,res)=>{ | ||
console.log(req.body) | ||
}) | ||
|
||
app.listen(8080, () => { | ||
console.log('listening on 8080') | ||
}) | ||
|
||
|
||
// Wine = red or white - dynamic change | ||
// Vqa = always | ||
// sugar content = in a range | ||
// cost = in a range | ||
|
||
// |
Oops, something went wrong.