C#C
C#9mo ago
Cyclomatic

c# API + angular front end

Hi,

This is more of a design question...

I have a web api written in C# and a front end writtein in angular. The web api has a settings file associated with it. The web api and front end are both served by kestrel (same port). The front end has some settings as well (in the assets folder). One setting, for example, for the front end is a theme. The theme can be changed using the front end, where it makes a request to the API to set the theme setting.

My question - I could have the theme setting live in the assets of the angular app, or I could have the setting live in a settings file in the API bin directory and when the frontend is loaded it makes a call to the API to get the settings and applies them. Which is the more common/better approach for storing this setting? I feel like it's better for it to live in the assets folder of the angular app, but more maintainable when it is in a settings file of the API.

Thoughts? (hope my question makes sense!)
Was this page helpful?