Skip to content
Advertisement

Tag: express-router

How to export and use a function using Express?

I have two file alarm.js and notifications.js. In alarm.js I need to call a method called sendPush from notifications.js. What I’ve tried : Exporting the function from notifications.js: Importing it in alarm.js and use it : The problem: I keep getting the error saying helperNotif.sendPush is not a function The question : How can I call this notification.js sendPush function

Advertisement