-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
Problem
Currently, the application crashes during startup if the .env file is missing because OsmoDoc.API.DotEnv.Load(dotenv) throws an exception when the file doesn't exist. This can cause issues during local development when the .env file is not present.
Location
File: OsmoDoc.API/Program.cs around lines 24-27
Suggested Solution
Check if the .env file exists using File.Exists(dotenv) before calling Load, and only call Load if the file is present. This prevents the application from crashing during local development when the .env file is absent.
Example Fix
string root = Directory.GetCurrentDirectory();
string dotenv = Path.GetFullPath(Path.Combine(root, "..", ".env"));
if (File.Exists(dotenv))
{
OsmoDoc.API.DotEnv.Load(dotenv);
}References
- PR: feat: make the core functions asynchronous #40
- Comment: feat: make the core functions asynchronous #40 (comment)
- Requested by: @osm-Jatin
Metadata
Metadata
Assignees
Labels
No labels