Is it possible to have multiple files/folders in server folder and import them as we wish inside the server folder

I am not able to import other files using require() like I do in node js. If I use like that, the module is importing as promise. Is it possible to run the server folder like a node js module.

Hi @sriram18,

Refer to this sample app that imports a file in the server.js file. The same can be done in any file to another within the server folder.

Suppose it doesn’t work for you. Could you show me how do you import the file? And how does the imported file export the variables, objects, or functions?

1 Like