We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e32ab25 commit ff9b2ccCopy full SHA for ff9b2cc
api/Services/BookService.cs
@@ -36,8 +36,9 @@ public ICollection<Book> GetBooks()
36
private ICollection<Book> LoadBooks()
37
{
38
// try and load from the book JSON data source (it will be readonly until we have a database backing the service).
39
+ var path = Environment.GetEnvironmentVariable("HOME") + @"\site\wwwroot\books.json";
40
var books = JsonSerializer
- .Deserialize<ICollection<Book>>(File.ReadAllText("books.json")) ?? new List<Book>();
41
+ .Deserialize<ICollection<Book>>(File.ReadAllText(path)) ?? new List<Book>();
42
43
// save them to the cache for the next call to save on disk/azure storage operations.
44
_cache.Set("books", books);
0 commit comments