read env vars from .env file

This commit is contained in:
Abdullah Atta
2022-12-28 17:33:18 +05:00
parent 4e9f82fe48
commit af9b357f3f
5 changed files with 9 additions and 11 deletions
+3
View File
@@ -0,0 +1,3 @@
NOTESNOOK_API_SECRET=
ORIGIN_CERT_PATH=
ORIGIN_CERT_KEY_PATH=
+1
View File
@@ -10,6 +10,7 @@
<ItemGroup>
<PackageReference Include="AWSSDK.Core" Version="3.7.12.5" />
<PackageReference Include="DotNetEnv" Version="2.3.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
+2 -11
View File
@@ -17,20 +17,9 @@ You should have received a copy of the Affero GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Amazon.S3;
using Amazon.S3.Model;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Https;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Streetwriters.Common;
namespace Notesnook.API
@@ -39,6 +28,8 @@ namespace Notesnook.API
{
public static async Task Main(string[] args)
{
DotNetEnv.Env.TraversePath().Load();
IHost host = CreateHostBuilder(args).Build();
await host.RunAsync();
}
+2
View File
@@ -33,6 +33,8 @@ namespace Streetwriters.Identity
{
public static async Task Main(string[] args)
{
DotNetEnv.Env.TraversePath().Load();
IHost host = CreateHostBuilder(args).Build();
await host.RunAsync();
}
@@ -13,6 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetEnv" Version="2.3.0" />
<PackageReference Include="IdentityServer4" Version="4.1.2" />
<PackageReference Include="MailKit" Version="3.4.3" />
<PackageReference Include="MessageBird" Version="3.2.0" />