I am working on an .net 5 web api projectt. I needed to use an external api (rapidapi.com etc.) . These websites gave me a apitoken. I know i should hide it , so no one at github would see it.
But also i should sent my apikey to my teacher so he could acces to, or hecan acces with his own apikey.
1.where sholud i store it? 2.How Should i store it? 3.How can i call it?
I know how to do it at JS, (its so easy, create .env file, and call it einvironmet.apikey ) , but don't know at .net. I need a simple solution like js
You should use "User secrets", as described by Microsoft.
It's very easy in Visual Studio where you just right click your project and choose "Manage User Secrets". This will create a file in this location: %APPDATA%\Microsoft\UserSecrets\<user_secrets_id>\secrets.json
This file is outside your project so it will never be a part of what you have in Github.