due to I’m not 100% sure how to store the api routes I want to ask the community if someonw has “best practices” with that.
In my solution we have different services with different base paths. So it’s not possible to configure e.g. the aurlia-fetch-client-base-path globally.
Following the approaches I tested:
- Saving the api routes using aurelia-configuration
- Positive: I can have all routes (prod, stage and dev ) in one file and the package handles the environments for me
- Negative: I have all routes (prod, stage and dev) always on each environment where I don’t need them and the files are quite big and confusing (not maintainable).
- Saving the routes in extra “typescript classes” and use the aurelia-cli environment handling
- Positive: I have the routes only where I need them and the it’s easy to deal with (maybe having an additional service that provides some functionalities e.g. to provide the full url meanign base-path and route).
- Negative: The files can only be maintained/configured by developers.
- Writing some external packages and load them via NPM (e.g. dev-dependency)
- Positive: That can be combined with a mock service providing some mock data.
- Negative: In case of errors it’s hard to debug respectively the development is much more difficult. For each route change the external package must be adjusted and pushed.
Can anybody give me a “best practise” or a tip?
Currently my application is small enough that I can change that. I don’t want to run into problems when the application becomes bigger.