You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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