Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor (Layer of Indirection) for Resource Fetch #62

Open
josh-byster opened this issue Nov 14, 2019 · 0 comments
Open

Refactor (Layer of Indirection) for Resource Fetch #62

josh-byster opened this issue Nov 14, 2019 · 0 comments
Labels
backend enhancement New feature or request

Comments

@josh-byster
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

We will be integrating with potentially multiple data sources (Mongo or a mock API for automated testing and dev work), while integrating with Salesforce for production. Currently, we have the retrieval of these resources directly embedded within the endpoints (i.e. the request to our database and that business logic happens within our backend). However, it would be ideal if that logic is handled through an external source, such that we can call getAllResources and the logic would be handled depending on what environment variable is set.

Describe the solution you'd like
A clear and concise description of what you want to happen.

There's a few ways we can architect this to ease our transition to using Salesforce in production. One way we might handle this would be through a small library we create within our backend that we can call into directly as part of our route handler for, say, GET /resources/. I envision us having an environment variable keeping track of the two use-cases: salesforce backend and our custom (Mongo) backend, and then have the library handle this logic. We essentially want to build an API for our backend API to consume (API galore!) so all the logic is abstracted.

@alan-fang alan-fang added the enhancement New feature or request label Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants