I will request you to summarize(in 1-3 min) whatever the project is about , either at the exact start or at the absolute end . Please do this for all upcoming streams. At the end would be better, because you can also walk us through the code as well.
I am trying to fetch data from zomato location api, I followed the same instruction as you followed in search, but I am getting 2 errors: 1) post method not allowed, 2)Uncaught(in promise) syntax error- unexpected end of json input.. I have been trying to debug it from last 2 days but couldn't find anything... Please help me... I am giving the snippet of the code //The post method app.post('/getLocations', async (req, res) => { try { const q = req.body.q; const data = await z.getLocations({ // entity_type: 'city', query }) const restaurants = data.location_suggestions.map(r => { return { entityType: r.entity_type, entitiyId: r.entity_id, title: r.title, latitude: r.latitude, longitude: r.longitude, cityName: r.city_name, cityId: r.city_id, countryName: r.country_name, } }) res.json({ restaurants }) } catch (err) { console.error(err); res.status(500).send('error, here') } }) //and in this piece I am getting error searchForm.addEventListener('submit', async e => { e.preventDefault(); const query1 = (e.target.querySelector('#city-name').value); if (query1 === '') { return } e.target.querySelector('#city-name').value = ''; const res = await fetch('/getLocations', { headers: { 'Content-Type': 'application/x-www-form-urlencoded' // Accept: 'application/json', // 'Content-Type': 'application/json' }, method: 'POST', body: '${query1}' }) const json = await res.json(); populateData(json.restaurants) });
For those who are working with this API - If you enter your API key, your search parameter below the API key and click the "Try it out!" button, Zomato will return with a response as well as the request URL
Please Reply: Is there such a thing as live code editing in vim like V.S code has. I like to code and edit my website live on my localhost but vim doesn’t support live server.
This might be what you're looking for github.com/tapio/live-server. Every time you save a file it will reload the page. I've used this for years. Does that answer your question?