diff options
| author | Adam Soltys <[email protected]> | 2012-11-06 20:38:48 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-11-06 20:38:48 -0800 |
| commit | 08f341f692688f077e9080bded2b14fdd5979c1e (patch) | |
| tree | cf962ed8dd97f96102b1678184076b53a39ad527 /clients.js | |
| parent | d407b638bc07ea0c7b05374c64e6d4b48770df86 (diff) | |
| download | coinos-server-08f341f692688f077e9080bded2b14fdd5979c1e.tar.gz coinos-server-08f341f692688f077e9080bded2b14fdd5979c1e.zip | |
Read parameters from client account
Diffstat (limited to 'clients.js')
| -rw-r--r-- | clients.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clients.js b/clients.js new file mode 100644 index 00000000..f75b5d52 --- /dev/null +++ b/clients.js @@ -0,0 +1,22 @@ +var http = require('http'); +var mysql = require('mysql'); +var url = require('url'); + +http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + var client = url.parse(req.url, true).query.client; + + var connection = mysql.createConnection({ + host : 'localhost', + user : 'root', + password : 'MPJzfq97', + database: 'vanbtc' + }); + + connection.connect(); + connection.query("SELECT * FROM users WHERE login = ?", [client], function(err, rows) { + res.write(JSON.stringify(rows)); + connection.end(); + res.end(); + }); +}).listen(8000); |
