Error connecting to database via Seriate Node JS

Asked

Viewed 22 times

-1

When I connect to my database locally it works normally. But when I deploy to Heroku returns me the following error:

Request Error: No connection is specified for that request

My configuration object is as follows:

var sql = require("seriate");

var config = {
    "server": "SERVER",
    "user": "USER_NAME",
    "password": "PASSWORD",
    "database": "DATABASE_NAME",
    "pool": {
      "max": 10,
      "min": 4,
      "idleTimeoutMillis": 60000
    }
};


sql.setDefaultConfig(config);

module.exports = sql

The credentials are correct, since I can connect to the bank locally. If anyone has anything to add will help me already a lot, I am hours researching and trying to solve and nothing.

1 answer

0

In the documentation config structure is like this:

{
    "name": "default",
    "host": "127.0.0.1",
    "port": "12345", // find the port of your instance in the SQL Server Configuration Manager
    "user": "nodejs",
    "password": "mypassword",
    "database": "master",
    "pool": {
        "max": 10,
        "min": 4,
        "idleTimeoutMillis": 30000
    }
}

Try to change "server" for "host"

The result would be like this:

var sql = require("seriate");

var config = {
    "host": "SERVER",
    "user": "USER_NAME",
    "password": "PASSWORD",
    "database": "DATABASE_NAME",
    "pool": {
      "max": 10,
      "min": 4,
      "idleTimeoutMillis": 60000
    }
};


sql.setDefaultConfig(config);

module.exports = sql

Browser other questions tagged

You are not signed in. Login or sign up in order to post.