Connect to SQL Server and Database
const Sequelize = require('sequelize'); | |
const sequelize = new Sequelize('database', 'username', 'password', { | |
host: 'SQL.server.address.database.net', | |
dialect: 'mssql', | |
dialectOptions: { | |
encrypt: true; | |
} | |
}); | |
sequelize | |
.authenticate() | |
.then(() => { | |
console.log('Connection has been established successfully.'); | |
}) | |
.catch(err => { | |
console.error('Unable to connect to the database:', err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment