Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. const user = await con.query(sql, [EP.email, EP.password]);
  2. ^^^ SyntaxError: Unexpected identifier at createScript (vm.js:74:10)
  3. at Object.runInThisContext (vm.js:116:10)
  4. at Module._compile (module.js:588:28)
  5. at Object.Module._extensions..js (module.js:635:10)
  6. at Module.load (module.js:545:32)
  7. at tryModuleLoad (module.js:508:12)
  8. at Function.Module._load (module.js:500:3)
  9. at Module.require (module.js:568:17)
  10. at require (internal/module.js:11:18)
  11. at Object.<anonymous> (/Users/Sern/Documents/test/server/lib/routes/login.js:4:16)
  12.  
  13. var database = {};
  14.  
  15. database.con = async function() {
  16.  
  17. const mysql = require('mysql2/promise');
  18.  
  19. const connection = await mysql.createConnection({
  20. host: "localhost",
  21. user: "root",
  22. database: "test",
  23. multipleStatements: true });   }
  24.  
  25. module.exports = database;
  26.  
  27. const database = require('../utils/database')
  28.  
  29. const con = database.con;
  30.  
  31. const Accounts = {};
  32.  
  33. Accounts.getByEP = function (EP, callback) {
  34.  
  35. var sql = "SELECT * FROM accounts WHERE email = ? and password = ?;";
  36.  
  37. const user = await con.query(sql, [EP.email, EP.password]);
  38.  
  39. callback(user);
  40.  
  41. };
  42.  
  43. module.exports = Accounts;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement