Skip to content

Commit

Permalink
Fixes resolving CRUD API data file. Closes #575 (#577)
Browse files Browse the repository at this point in the history
Adds showing error when can't load CRUD API data file. Closes #576
  • Loading branch information
waldekmastykarz authored Feb 23, 2024
1 parent 238f6da commit 957ddc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dev-proxy-plugins/MockResponses/CrudApiPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ private void LoadData()
{
try
{
var dataFilePath = Path.GetFullPath(ProxyUtils.ReplacePathTokens(_configuration.DataFile), Path.GetDirectoryName(_proxyConfiguration?.ConfigFile ?? string.Empty) ?? string.Empty);
var dataFilePath = Path.GetFullPath(ProxyUtils.ReplacePathTokens(_configuration.DataFile), Path.GetDirectoryName(_configuration.ApiFile) ?? string.Empty);
if (!File.Exists(dataFilePath))
{
_logger?.LogError($"Data file '{dataFilePath}' does not exist. The {_configuration.BaseUrl} API will be disabled.");
_configuration.Actions = Array.Empty<CrudApiAction>();
return;
}
Expand Down

0 comments on commit 957ddc5

Please sign in to comment.