Enable CORS so sites can use directly in JS. Fixes #43.
This commit is contained in:
		@@ -18,6 +18,12 @@ app.use(express.cookieParser());
 | 
			
		||||
app.use(express.static(__dirname + '/public'));
 | 
			
		||||
app.use(express.json());
 | 
			
		||||
app.use(express.urlencoded());
 | 
			
		||||
app.use(function(req, res, next) {
 | 
			
		||||
  // Enable CORS so sites can use the API directly in JS.
 | 
			
		||||
  res.header('Access-Control-Allow-Origin', '*');
 | 
			
		||||
  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
 | 
			
		||||
  next();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// Enable log messages when sending texts.
 | 
			
		||||
text.debug(true);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user