Code Monkey home page Code Monkey logo

invoice-generator-webapi's Introduction

InvoiceGenerator.WebApi

Test coverage Build status
Code Coverage Run all tests

User Secrets

In order to hide the connection string from config (as this is an open source repo), the connection string has been hidden in a User Secret. All user secrets are loaded in AFTER appsettings.json files, so this works brilliantly for local development.

To add the connection string to a user secret:

  • Open a terminal in the InvoiceGenerator.WebApi directory
  • Run dotnet user-secrets init
    • You should be told "The MSBuild project 'InvoiceGenerator.WebApi.csproj' has already been initialized with a UserSecretsId."
    • This is good
  • Run dotnet user-secrets set "ConnectionStrings:invoiceConnectionString" "YOUR CONNECTION STRING HERE"
    • Replacing "YOUR CONNECTION STRING HERE" with the actual connection string
    • This will place the connection string in a user secret
    • Only someone running this application, when logged into your machine as you will get the connection string
    • The connection string will be injected at application boot time

To check that the connection string was added correctly:

  • Open a terminal in the InvoiceGenerator.WebApi directory
  • Run dotnet user-secrets list
  • The output should be ConnectionStrings:invoiceConnectionString = YOUR CONNECTION STRING HERE
    • Where YOUR CONNECTION STRING HERE is the connection string you provided when setting the user secret

To remove the connection string secret:

  • Open a terminal in the InvoiceGenerator.WebApi directory
  • Run dotnet user-secrets remove "ConnectionStrings:invoiceConnectionString"
  • This will remove the connection string from your user secrets
    • You will either have to replace this or set it in the appsettings.json file

invoice-generator-webapi's People

Contributors

jamie-taylor-rjj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.