From aa4e552a03657a63922f5cd085431257c183f458 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Mon, 2 Jul 2018 19:52:25 +0000 Subject: [server] Initial commit to add the node server stuff. --- server/api/clients.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 server/api/clients.js (limited to 'server/api/clients.js') diff --git a/server/api/clients.js b/server/api/clients.js new file mode 100644 index 0000000..53aeb9d --- /dev/null +++ b/server/api/clients.js @@ -0,0 +1,20 @@ +/* global __appdir */ +var path = require('path'); +var db = require(path.join(__appdir, 'lib', 'sequelize')); + +module.exports = { + get: function(req, res) { + //db.sequelize.authenticate() + //.then(() => { console.log('Connection has been established successfully.'); }) + //.catch(err => { console.error('Unable to connect to the database:', err); }); + + //db.users2.create({ username: "wasd", password: "wasd", email: "w@a.de", name: "wa"}); + db.users2.findOne({ where: { username: 'wasd' } }).then(user => { + console.log(user.get('username')); + }); + res.end(); + }, + post: function(req, res) { + + } +} \ No newline at end of file -- cgit v1.2.3-55-g7522