Я пытаюсь создать простое приложение функций Azure World Hello, используя nodejs и express. Но я получаю следующую ошибку:
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.
Вот мой код:
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"
}
}
Тогда у меня есть каталог node_modules
в приложении-функции
Любая помощь приветствуется. Заранее спасибо!