mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-16 04:15:56 +00:00
Something is up
This commit is contained in:
38
api.test.js
38
api.test.js
@@ -1,6 +1,4 @@
|
||||
const request = require('superagent');
|
||||
const brewData = require('./server/brew.data.js');
|
||||
|
||||
const path = 'localhost:8000';
|
||||
|
||||
request.post(`${path}/api/brew`)
|
||||
@@ -9,29 +7,21 @@ request.post(`${path}/api/brew`)
|
||||
})
|
||||
.end((err, res) => {
|
||||
console.log(err, res && res.body);
|
||||
});
|
||||
|
||||
console.log('creaitng brew');
|
||||
|
||||
//creating brew
|
||||
/////////
|
||||
|
||||
const db = require('./server/db.js');
|
||||
const brewData = require('./server/brew.data.js');
|
||||
|
||||
|
||||
db.connect()
|
||||
.then(()=>{
|
||||
brewData.create({
|
||||
text : 'yeah yeah'
|
||||
text : 'test'
|
||||
})
|
||||
.then((brew) => {
|
||||
console.log(brew);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
})
|
||||
|
||||
/*
|
||||
res.body.text = 'check it';
|
||||
brewData.update(res.body)
|
||||
.then((newBrew) => {
|
||||
console.log(newBrew);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
})
|
||||
*/
|
||||
})
|
||||
|
||||
.then((brew)=>{
|
||||
console.log(brew);
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user