mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-13 10:45:57 +00:00
27 lines
421 B
JavaScript
27 lines
421 B
JavaScript
const request = require('superagent');
|
|
const path = 'localhost:8000';
|
|
|
|
request.post(`${path}/api/brew`)
|
|
.send({
|
|
text : 'new brew'
|
|
})
|
|
.end((err, res) => {
|
|
console.log(err, res && res.body);
|
|
});
|
|
|
|
|
|
/////////
|
|
|
|
const db = require('./server/db.js');
|
|
const brewData = require('./server/brew.data.js');
|
|
|
|
|
|
db.connect()
|
|
.then(()=>{
|
|
brewData.create({
|
|
text : 'test'
|
|
})
|
|
.then((brew)=>{
|
|
console.log(brew);
|
|
})
|
|
}) |