I am using azure functions written in NODE JS. I am starting the local server with
func host start
and everything works fine. But the problem is when i change something in my azure functions - index.js file for example when i add one simple console log
module.exports = async function (context, req) {
console.log('request came');
context.res = {
body: { success: true, message: null, response: context.bindings.inputDocument }
};
};
the server is not restarted, and i need to stop the server run again func host start to see the changes which is not good. In nodejs we have nodemon, is there something to this in azure functions with which i can watch for changes without stoppint and starting the server on every change ?
what i tried
I tried adding in my host.json file
"watchDirectories": [ "*" ]
but without success.
Also i tried
editing the start property in the scripts
in package.json file
"scripts": {
"start": "start npm run watch & npm run start:host",
"test": "echo \"No tests yet...\""
},
instead
"scripts": {
"start": "func start",
"test": "echo \"No tests yet...\""
},
but still no success.
I am using azure functions v2.