Answer the question
In order to leave comments, you need to log in
Error code: 'ELOGIN'?
Code from app.js:
'use strict';
const PORT = 3000;
var express = require('express')
var bodyParser = require('body-parser')
var app = express();
var routes = require('./routes/index')
var publicDir = (__dirname + '/public');
app.use(express.static(publicDir));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.listen(PORT, () => { console.log("ASOM API running") });
const sql = require('mssql')
var config = {
user: 'sa',
password: '******',
server: 'localhost',
database: 'ASOM',
"options": {
"encrypt": true,
"enableArithAbort": true
}
};
const poolPromised = new sql.ConnectionPool(config)
.connect()
.then(pool => {
console.log('Connected to MSSQL')
return pool
}).catch(err => console.log('Database connection failed! Bad congig: ', err))
module.exports = {sql,poolPromised}
var API_KEY = "1234"
var express = require('express')
var router = express.Router();
const { poolPromise, sql } = require('../db')
router.get('/', function (req, res) {
res.end("API RUNNING")
});
module.exports = router;
Answer the question
In order to leave comments, you need to log in
Look at the MS SQL log.
To improve security, the error message returned to the client intentionally hides the nature of the authentication error. However, in the SQL Server error log, the associated error has a status that can be mapped to authentication failure conditions. Compare the error status with the following list to determine the cause of the login failure.Link in previous question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question