-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Load templates from external source #256
Comments
@KirioXX could you provide a simple example? Import should work even with edge functions, I've tested it with Deno Deploy. If you need you can just pass in a dummy string to I like the idea of allowing URL import, but it should probably work through an Eta plugin rather than be added to the source code. |
Thanks for coming back to me @nebrelbug. I just used the quick start example to build the following function (the template folder is in the same folder as the index.ts):
When I call this function I get this error:
Did you import the templates differently? To provide more context on why it would be beneficial to import templates from an external source, consider the following. I am looking to create a platform similar to [Apitemplate](https://apitemplate.io/). The idea is to give non-technical personnel within the company a playground where they can modify PDF templates using only HTML and CSS. If we can load the templates from a separate repository, the playground could exist independently of our main backend. This would allow changes to be made without affecting the history of our main project. Thank you! |
@KirioXX sounds like a cool project! I think I've tracked the error down. Will you try seeing if you can call There's a chance that filesystem operations, which now work with Deno Deploy, still don't work with Supabase edge functions. If that's the case, the best option may be to create an Eta plugin or pass through a function that can fetch remote templates. Or, you can define templates as strings and then load them using See also #172. |
Is your feature request related to a problem? Please describe.
I trie to run eta in a supabase edge function (deno deploy) those function seam not to support the import for template files.
As a alternative to that I was thinking it would be great if we could import the templates from a Github repository or a S3 bucket.
Describe the solution you'd like
As a alternative to instead of a folder path for views specifying a url to a external source that contains the templates.
Describe alternatives you've considered
I think about using a inline template but that is failing at the moment because the config seams to require a views path.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: