fetch data from external url nodejs
const fetch = require('node-fetch');
app.get('/', function (req, res) {
var url = 'https://api.darksky.net/forecast/<API KEY>/37.8267,-122.4233';
fetch(url)
.then(res => res.json())
.then(data => {
res.send({ data });
})
.catch(err => {
res.send(err);
});
});
Also in JavaScript:
- javascript virtual assistant scrip[t
- macos chrome disable web security
- bootstrap show modal on page load
- js change key value in object
- jquery append to table
- how to make a dictionary javascript
- professional react projects
- js date remove am and pm
- replace js
- * ws in ./node_modules/puppeteer/lib/WebSocketTransport.js
- javascript object to query string
- get response api using vanilajavascript
- saveas angular 6
- angular router with wuery param
- how to go to settings on next click in react native
- javascript pop object from array
- sort numbers in array javascript
- discord.js set playing tag
- Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
- javascript join list of string
- my datatable in flutter from json repeat the column headers
- Checking whether a value exists in an array javascript
- how to make a var and sprite in javascript
- how to run different node app on server different domains