diff --git a/web-server/src/app.js b/web-server/src/app.js index ce467f2..928dfad 100644 --- a/web-server/src/app.js +++ b/web-server/src/app.js @@ -40,9 +40,29 @@ app.get('/help', (req, res) => { }) app.get('/weather', (req, res) => { + if (!req.query.address) { + return res.send({ + error: 'You must provide an address!' + }) + } + res.send({ - forecast: 'It is snowing. In September.', - location: 'Calgary' + forecast: 'It\'s pretty nice out. Not bad, really.', + location: 'Calgary', + address: req.query.address + }) +}) + +app.get('/products', (req, res) => { + if (!req.query.search) { + return res.send({ + error: 'You must provide a search term' + }) + } + + console.log(req.query.search) + res.send({ + products: [] }) })