Skip to content

Instantly share code, notes, and snippets.

Created May 1, 2018
What would you like to do?
Connect to SQL Server and Database
const Sequelize = require('sequelize');
const sequelize = new Sequelize('database', 'username', 'password', {
host: '',
dialect: 'mssql',
dialectOptions: {
encrypt: true;
.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