I'm creating a Node.js/Express.js app with Sequelize as my ORM. This is the tutorial I'm following. I'm having trouble migrating my tables onto my Azure SQL database.
My config/config.json file is as such:
{
"development" : {
"use_env_variable" : "DATABASE_URL",
"dialect" : "mssql"
}
}
My .env file is as such:
DATABASE_URL=<connection string here>
These are being called by this code in models/index.js:
'use strict';
var fs = require('fs');
var path = require('path');
var Sequelize = require('sequelize');
var basename = path.basename(module.filename);
var env = process.env.NODE_ENV || 'development';
var config = require(__dirname + '/../config/config.json')[env];
var db = {};
if (config.use_env_variable) {
var sequelize = new Sequelize(process.env[config.use_env_variable]);
} else {
var sequelize = new Sequelize(config.database, config.username, config.password, config);
}
I have require('dotenv').config() in my main file app.js. My understanding was that the dotenv package exports all of my .env variables throughout my project.
When I try running node_modules/.bin/sequelize db:migrate in the terminal, I get
ERROR: Error parsing url: undefined
Why is it coming back as undefined?
Here is my file structure in case it helps.

require(path.join(__dirname, '../config/config.json'))?