Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const user = await con.query(sql, [EP.email, EP.password]);
- ^^^ SyntaxError: Unexpected identifier at createScript (vm.js:74:10)
- at Object.runInThisContext (vm.js:116:10)
- at Module._compile (module.js:588:28)
- at Object.Module._extensions..js (module.js:635:10)
- at Module.load (module.js:545:32)
- at tryModuleLoad (module.js:508:12)
- at Function.Module._load (module.js:500:3)
- at Module.require (module.js:568:17)
- at require (internal/module.js:11:18)
- at Object.<anonymous> (/Users/Sern/Documents/test/server/lib/routes/login.js:4:16)
- var database = {};
- database.con = async function() {
- const mysql = require('mysql2/promise');
- const connection = await mysql.createConnection({
- host: "localhost",
- user: "root",
- database: "test",
- multipleStatements: true }); }
- module.exports = database;
- const database = require('../utils/database')
- const con = database.con;
- const Accounts = {};
- Accounts.getByEP = function (EP, callback) {
- var sql = "SELECT * FROM accounts WHERE email = ? and password = ?;";
- const user = await con.query(sql, [EP.email, EP.password]);
- callback(user);
- };
- module.exports = Accounts;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement