How can I define two functions which refer to the handler from those sub-directory, instead of put 2 js files to the src?
The below code does not work for me.
Can you please give little more explanation on how exporting the admin/index.js into index.js.
with a little structure format would be helpful with basic example.
If you have multiple modules then it usually make sense to separate your backend functions out into their own files - one for each module for ease of maintenance.
Here’s an example manifest with two modules: macro and confluence:spacePage.
The entrypoint for the functions are index.macroHandler and index.spacePageHandler respectively.
And finally, in src/index.js you need to export these two handlers.
export { macroHandler } from "./handlers/macro";
export { spacePageHandler } from "./handlers/spacePage";
This is important because Forge requires that we point to our backend functions using the file.function format e.g. index.macroHandler and index.spacePageHandler.
Hey @BentleyCook, this way can I make directory structure like backend/src and frontend/src ?
In ‘backend’ folder store resolvers and in ‘frontend’ folder - frontend code?
In that case index.js would be in backend/src/index.js
Unfortunately having sources not under the src root directory isn’t supported. Please upvote FRGE-422 to show it’s important to you, and start a new thread if you have further questions!