Review Content Library directory resolution. Is there a better way that doesn't involve 10 different programming patterns?
Right now the default is a hardcoded reference to the runtime location of the content: ./Content/ but I have a strong suspicion that this is going to break during deployment, interim builds or on Windows.
The default is overridable in the constructor but there has to be a better .NETty way of doing this. Would love your thoughts:
https://github.com/robconery/Vue.Starter/blob/main/templates/vue/server/Data/ContentLibrary.cs#L17
I think environment variables are the easiest way to provide a value in this case especially if you want it to work well across various build systems. If an ENV var isn't supplied then the default or constructor override (if supplied) would win. Not sure if that's what you're asking exactly so if not let me know. :-)
I was leaning in that direction but for some reason I hate ENV variables for directory settings. Unreasonable of me I guess. What about appsettings?
I think appsettings works fine for that too. The reason I lean toward ENV vars is they’re outside of the app and easier to change in build systems. But, with something like a directory, it probably makes more sense to make them officially part of the app and appsettings makes that easy.