// server.js
var express = require('express');
var app = express();
var path = require('path');
//app.use(express.static(__dirname)); // Current directory is root
app.use(express.static(path.join(__dirname, 'public')));
app.listen(8080);
console.log('Listening on port 8080');
$ node server.js
и идем на localhost:8080 fetch('https://vk.com/feed2.php')
.then(function(response) {
console.log(response.headers.get('Content-Type'));
console.log(response.status);
return response.json();
})
.then(function(user) {
console.log(user.id);
})
.catch( console.log );