diff --git a/main.js b/main.js index fb94041..3956cf7 100644 --- a/main.js +++ b/main.js @@ -54,6 +54,13 @@ var http = require('http'); // socket for sending data to the printer const Net = require('net'); +// cors option +rest.use(function(res, next) { + res.header("Access-Control-Allow-Origin", "http://localhost:3000"); // use your own domain + res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); + res.header("Access-Control-Allow-Credentials", true) + next(); +}); // Main rest.get('/', function(req, res) {