I am trying to create a simple hello world azure functions app using nodejs and express. But, i am getting the following error:
Exception while executing function: Functions.httpexpressapp. mscorlib: Unable to determine function entry point. If multiple functions are exported, you must indicate the entry point, either by naming it 'run' or 'index', or by naming it explicitly via the 'entryPoint' metadata property.
Here is my code:
function.json
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
],
"entryPoint": "index",
"disabled": false
}
index.js:
const express = require('express')
const app = express()
app.get('/', (req, res) => res.send('Express JS Hello World App!!!'))
package.json:
{
"name": "httpexpressapp",
"version": "1.0.0",
"description": "sample app",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "john doe",
"license": "ISC",
"dependencies": {
"express": "^4.16.3"
}
}
Then, i have a node_modules directory under the function app
Any help is appreciated. Thanks in advance!