environment-variables

Dotenv not loading properly

我的梦境 提交于 2020-01-03 15:53:50
问题 I am trying to access some environment variables using process.env that were loaded by dotenv . My folder structure : .env src -- - server.js My server.js configuration : (...) import auth from './middleware/auth' import dotenv from 'dotenv' dotenv.load({ path: '../', silent: process.env.NODE_ENV === 'production' }) auth() // Instantiate app const app = express(); The file where I try to access process.env variable : (...) module.exports = function() { console.log("env", process.env.MONGODB

How to set environment variables per site on IIS using appcmd.exe?

点点圈 提交于 2020-01-03 11:57:23
问题 It is very easy to set environment variables per site on IIS Manager: I looking for a way to do it using appcmd.exe so I can include this in my install script. The closest I got was this: C:\>C:\Windows\System32\inetsrv\appcmd.exe set config "dashboard" -section:system.webServer/aspNetCore /environmentVariables.[name='foo',value='bar'] /commit:apphost -> dashboard is my site's name. But this command returns this error: ERROR ( message:Cannot find requested collection element. ) 回答1: You may

@RefreshScope with @ConditionalOnProperty does not work

房东的猫 提交于 2020-01-03 09:09:16
问题 Problem Exploring an option of enabling/disabling a @RequestMapping endpoint on demand without restarting JVM. Implement a kill switch on a endpoint at runtime. Attempt I've tried the following but @RefreshScope does not seem to work with @ConditionOnProperty @RestController @RefreshScope @ConditionalOnProperty(name = "stackoverflow.endpoints", havingValue = "enabled") public class MyController { @Value("${stackoverflow.endpoints}") String value; @RequestMapping(path = "/sample", method =

Unable to verify certificate - please set 'ENV['SSL_CERT_FILE'] = path_to_file'

余生长醉 提交于 2020-01-03 08:24:27
问题 I have a Rails 4 application that uses Carrierwave to upload files. After installing Fog to upload files to Amazon 3, I started getting the following error when uploading files: Excon::Errors::SocketError in VideosController#create Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file`, `Excon.defaults[:ssl_verify_callback] = callback`

CMD enviroment variables not expanded in PATH variable

 ̄綄美尐妖づ 提交于 2020-01-03 02:12:38
问题 I've some enviroment variables set in my sistem preferences (Windows 8.1). If i start cmd.exe and execute this commands: C:\Users\Carlo>echo %GRAILS_HOME% D:\Grails C:\Users\Carlo>echo %GRADLE_HOME% D:\Gradle C:\Users\Carlo>echo %GROOVY_HOME% D:\Groovy C:\Users\Carlo>echo %PATH% C:\ProgramData\Oracle\Java\javapath;c:\Program Files (x86)\Intel\iCLSClient\; c:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows; C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\; C

Defining Node environment in Nest.js

两盒软妹~` 提交于 2020-01-02 17:12:30
问题 I'm in the process of setting up Nest.js project and I look for the efficient solution of defining Node environment which is used by the ConfigService for loading environment variables: import { Module } from '@nestjs/common'; import { ConfigService } from './config.service'; @Module({ providers: [ { provide: ConfigService, useValue: new ConfigService(`environments/${process.env.NODE_ENV}.env`) } ], exports: [ConfigService] }) export class ConfigModule {} Right now I'm defining it directly in

Local XSL reference within XML-File

泄露秘密 提交于 2020-01-02 08:45:15
问题 First a short task description: There is an XML file which references a xsl stylesheet which is within a *.dll. The beginning of this XML looks as follows: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type='text/xsl' href='res://name_xsl.dll/frameset.xsl'?> This xml file can be opened and displayed as an HTML within Internet Explorer and only IE. (The xsl transform the xml to html) As you can see it references the win32 system folder , in which the dll file is saved. Referencing

Default values of path variables in windows 10 [closed]

半城伤御伤魂 提交于 2020-01-02 05:39:39
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I changed my path values by mistake. so i need default path values for windows 10 pro 64 bit. 回答1: I find the answer here: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ This is copied from a Win 10 Enterprise 64Bit System I set up yesterday (no

Docker Compose Nested Environment Variable

房东的猫 提交于 2020-01-02 05:01:08
问题 I have an existing app that uses a app config file that looks like: "ConnectionInfo": { "ServerName": "The Server URL", "DatabaseName": "The DatabaseName", "UserName": "The User Name", "Password": "The Password"} Now, when I have a simple setting, say "ConnectionString":"My Connection String" I understand how to override it in the compose.yml file: environment: - ConnectionString=what I want it to be The question is, how do you set, say, the server name in the top? 回答1: Please use underscore

How do you add environment variables to your django project

做~自己de王妃 提交于 2020-01-02 04:35:26
问题 I'm trying to set up my project so that it can use environment variables locally Ive tried adding it to the end of my activate file and a list of other things. I'm trying to use this from .base import * if os.environ['DJANGO_SERVER_TYPE'] == 'local': try: from .local import * except: pass if os.environ['DJANGO_SERVER_TYPE'] == 'production': try: from .production import * except: pass I am a real novice and often things are explained brief and matter of factly. So a thorough explanation would