Replies: 1 comment
-
As a static site generator, Framework does not (and can not) support any such API. (It only outputs “static” files.) Any logic you want to add would need to be programmed outside of Framework. I'd generally recommend checking out val.town for this if you want to code in JavaScript or TypeScript, but there are many options. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to create custom APIs in our Observable Framework applications? Since the applications are based on Node.js it seems like we should but I can't find any documentation on this (beyond parameterizing .md urls).
Essentially, I perform some initialization during the application startup and want to be able to access data from that initialization with API calls. When I Google or consult AI (seems like more "AI lies") I get that I need to create a folder structure src/routes/api and put .js files there which export POST/GET/etc. methods. Seems logical but it doesn't work. Both Copilot and ChatGPT indicate that this is possible and it seems reasonable but I can find no Observable documentation to confirm.
Also, using Express doesn't seem to work.
If anyone has accomlished this I would appreciate any insight. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions