How to use dotenv-extended - 10 common examples

To help you get started, we’ve selected a few dotenv-extended examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mhaidarh / super-workshop-js / tests / test-chai / api / auth.js View on Github external
require('dotenv-extended').load()
const server = require(process.env.SERVER_DIR + 'server')

const chai = require('chai')
const expect = chai.expect
chai.use(require('chai-http'))

// -----------------------------------------------------------------------------
// CONFIGURE MAIN RESOURCES + ENDPOINTS

const resource = `account`
const resources = `${resource}s`
const endpoint = `/api/${resources}`

// -----------------------------------------------------------------------------
// CREATE A FAKE DATA
github microsoft / BotBuilder-Samples / Node / core-DirectLine / DirectLineBot / app.js View on Github external
// This loads the environment variables from the .env file
require('dotenv-extended').load();

var builder = require('botbuilder');
var restify = require('restify');

// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
    console.log('%s listening to %s', server.name, server.url);
});

// Create connector and listen for messages
var connector = new builder.ChatConnector({
    appId: process.env.MICROSOFT_APP_ID,
    appPassword: process.env.MICROSOFT_APP_PASSWORD
});
server.post('/api/messages', connector.listen());
github microsoft / BotBuilder-Samples / Node / core-State / app.js View on Github external
// This loads the environment variables from the .env file
require('dotenv-extended').load();

var builder = require('botbuilder');
var restify = require('restify');

// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
    console.log('%s listening to %s', server.name, server.url);
});

// Create connector and listen for messages
var connector = new builder.ChatConnector({
    appId: process.env.MICROSOFT_APP_ID,
    appPassword: process.env.MICROSOFT_APP_PASSWORD
});
github microsoft / BotBuilder-Samples / Node / demo-RollerSkill / app.js View on Github external
/*-----------------------------------------------------------------------------
Roller is a dice rolling skill that's been optimized for speech. 
-----------------------------------------------------------------------------*/

require('dotenv-extended').load();
var restify = require('restify');
var builder = require('botbuilder');
var ssml = require('./ssml');

// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
   console.log('%s listening to %s', server.name, server.url); 
});
  
// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
    appId: process.env.MICROSOFT_APP_ID,
    appPassword: process.env.MICROSOFT_APP_PASSWORD
});
github microsoft / BotBuilder-Samples / Node / core-MultiDialogs / app.js View on Github external
// This loads the environment variables from the .env file
require('dotenv-extended').load();

var builder = require('botbuilder');
var restify = require('restify');

// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
    console.log('%s listening to %s', server.name, server.url);
});

// Create chat bot and listen to messages
var connector = new builder.ChatConnector({
    appId: process.env.MICROSOFT_APP_ID,
    appPassword: process.env.MICROSOFT_APP_PASSWORD
});
server.post('/api/messages', connector.listen());
github drupal-graphql / drupal-decoupled-app / internals / scripts / dropDatabase.js View on Github external
/**
 * @file    database drop script.
 * @author  Sebastian Siemssen 
 * @date    2016-06-21
 */

import mongoose from 'mongoose';

// Load the environment configuration.
require('dotenv-extended').config({
  path     : '.env.local',
  defaults : '.env',
});

// Use promises for mongoose async operations.
mongoose.Promise = Promise;

/**
 * drop database
 *
 * @desc   main entry point for this script
 * @return {null}
 */
const dropDatabase = () => {
  console.log('Starting to drop the entire database.');
github microsoft / BotBuilder-Samples / Node / core-GetConversationMembers / app.js View on Github external
// This loads the environment variables from the .env file
require('dotenv-extended').load();

var builder = require('botbuilder');
var restify = require('restify');
var Promise = require('bluebird');
var url = require('url');
var Swagger = require('swagger-client');

// Swagger client for Bot Connector API
var connectorApiClient = new Swagger({
    url: 'https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector.Shared/Swagger/ConnectorAPI.json',
    usePromise: true
});

// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
github microsoft / BotBuilder-Samples / Node / demo-Search / app.js View on Github external
// This loads the environment variables from the .env file
require('dotenv-extended').load();

// This startup file is meant to be used only when deploying any of the samples to an Azure Website

var botName = process.env.BOT || 'RealEstateBot';
var botModule = './' + botName + '/app'; 
require(botModule);
github microsoft / BotBuilder-Samples / Node / core-SendAttachment / app.js View on Github external
// This loads the environment variables from the .env file
require('dotenv-extended').load();

var builder = require('botbuilder');
var restify = require('restify');
var Swagger = require('swagger-client');
var Promise = require('bluebird');
var url = require('url');
var fs = require('fs');
var util = require('util');

// Swagger client for Bot Connector API
var connectorApiClient = new Swagger(
    {
        url: 'https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector.Shared/Swagger/ConnectorAPI.json',
        usePromise: true
    });
github nzthiago / BotInsightsTests / Node / bot.js View on Github external
var builder = require('botbuilder');
require('dotenv-extended').load();
var telemetryModule = require('./telemetry-module.js');
var appInsights = require('applicationinsights');

function create(connector) {
    
    appInsights.setup(process.env.APPINSIGHTS_INSTRUMENTATIONKEY).start();
    var appInsightsClient = appInsights.getClient();

    var HelpMessage = '\n * If you want to know which city I\'m using for my searches type \'current city\'. \n * Want to change the current city? Type \'change city to cityName\'. \n * Want to change it just for your searches? Type \'change my city to cityName\'';
    var UserNameKey = 'UserName';
    var UserWelcomedKey = 'UserWelcomed';
    var CityKey = 'City';

    // Setup bot with default dialog
    var bot = new builder.UniversalBot(connector, function (session) {

dotenv-extended

A module for loading .env files and optionally loading defaults and a schema for validating all values are present.

MIT
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis

Popular dotenv-extended functions