Skip to content

Commit

Permalink
alaserver.js CRLF -> LF
Browse files Browse the repository at this point in the history
  • Loading branch information
agershun committed Apr 13, 2015
1 parent 46e51db commit d94cfae
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions bin/alaserver.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/usr/bin/env node
//
// alaserver.js = Alasql Server
// Date: 25.11.2014
// (c) 2014, Andrey Gershun
//

var alasql = require('alasql');
var http = require('http');
var url = require('url');
var port = (process.argv[2] || 1337)|0;
if(!port) {
throw new Error('Wrong port number '+process.argv[3]);
}

http.createServer(function (req, res) {
var sql = decodeURI(url.parse(req.url).search).substr(1);
var a = '';
try {
a = alasql(sql);
} catch(err) {
a = err.toString();
};
res.writeHead(200, {'Content-Type': 'application/json'});
res.end(JSON.stringify(a));
}).listen(port, '127.0.0.1');

console.log('Server running at http://127.0.0.1:'+port+'/');
#!/usr/bin/env node
//
// alaserver.js = Alasql Server
// Date: 25.11.2014
// (c) 2014, Andrey Gershun
//

var alasql = require('alasql');
var http = require('http');
var url = require('url');
var port = (process.argv[2] || 1337)|0;
if(!port) {
throw new Error('Wrong port number '+process.argv[3]);
}

http.createServer(function (req, res) {
var sql = decodeURI(url.parse(req.url).search).substr(1);
var a = '';
try {
a = alasql(sql);
} catch(err) {
a = err.toString();
};
res.writeHead(200, {'Content-Type': 'application/json'});
res.end(JSON.stringify(a));
}).listen(port, '127.0.0.1');

console.log('Server running at http://127.0.0.1:'+port+'/');

0 comments on commit d94cfae

Please sign in to comment.