Tutorial by Examples

var http = require('http'); var fs = require('fs'); var path = require('path'); http.createServer(function (request, response) { console.log('request ', request.url); var filePath = '.' + request.url; if (filePath == './') filePath = './index.html'; var extname = String(path.extnam...
// Website you wish to allow to connect to response.setHeader('Access-Control-Allow-Origin', '*'); // Request methods you wish to allow response.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); // Request headers you wish to allow response.setHeader('Acce...

Page 1 of 1