Im getting the following error:
Failed to load resource: the api/data?small=&medium=&large=:1 server responded with a status of 503 (Service Unavailable)
Im trying to fetch from my heroku pgdb but it doesnt seem to be connecting. It works fine when I had the localhost set up. why?
useEffect(()=>{
Axios.get('/api/data', {params: {small:(checkedA ? "" : "small"), medium:(checkedB ? "" : "medium"), large:(checkedC ? "" : "large")}})
.then(res=>{
setDogList(res.data);
})
}, [checkedA, checkedB, checkedC])
app.get('/api/data', async(req, res)=>{
const small = req.query.small;
const medium = req.query.medium;
const large = req.query.large;
try{
const getCity = await pool.query("SELECT * FROM dogs WHERE size NOT IN (($1), ($2), ($3)) ORDER BY breed",[small, medium, large]);
res.json(getCity.rows)
}catch(err){
console.log(err.message)
}
})