when i use fetch API I AM GETTING NOTHING ON MY LOCAL HOST
THIS IS MY CODE var express = require("express"); var app = express(); app.listen(3000, () => { console.log("Server running on port 3000"); });
const fetch = require('node-fetch'); fetch('URL') .then(res => res.json())//response type .then(data => console.log(data));
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a blogging-forward open source social network where we learn from one another
when i use fetch API I AM GETTING NOTHING ON MY LOCAL HOST
THIS IS MY CODE
var express = require("express");
var app = express();
app.listen(3000, () => {
console.log("Server running on port 3000");
});
const fetch = require('node-fetch');
fetch('URL')
.then(res => res.json())//response type
.then(data => console.log(data));