{"id":13583793,"url":"https://github.com/yvele/azure-function-express","last_synced_at":"2025-04-05T08:07:28.327Z","repository":{"id":52495629,"uuid":"72630744","full_name":"yvele/azure-function-express","owner":"yvele","description":"⚡️Allows Express.js usage with Azure Functions","archived":false,"fork":false,"pushed_at":"2023-07-03T09:14:55.000Z","size":171,"stargazers_count":171,"open_issues_count":15,"forks_count":47,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-29T07:07:17.137Z","etag":null,"topics":["azure","azure-functions","azure-webjobs-sdk","expressjs","serverless"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yvele.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-11-02T10:51:32.000Z","updated_at":"2025-03-12T12:53:25.000Z","dependencies_parsed_at":"2024-01-06T23:54:45.268Z","dependency_job_id":"c046a3f2-65b7-432f-85d4-283486c81692","html_url":"https://github.com/yvele/azure-function-express","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":0.0980392156862745,"last_synced_commit":"2bd90411b20480f2e430d730b638974d3391e671"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fazure-function-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fazure-function-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fazure-function-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvele%2Fazure-function-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yvele","download_url":"https://codeload.github.com/yvele/azure-function-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305934,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-functions","azure-webjobs-sdk","expressjs","serverless"],"created_at":"2024-08-01T15:03:48.313Z","updated_at":"2025-04-05T08:07:28.304Z","avatar_url":"https://github.com/yvele.png","language":"JavaScript","funding_links":[],"categories":["Frameworks","JavaScript"],"sub_categories":[],"readme":"# azure-function-express\n\n\u003ca href=\"https://azure.microsoft.com/en-us/services/functions/\"\u003e\n  \u003cimg align=\"right\" alt=\"Function logo\" src=\"docs/media/function.png\" title=\"Function\" width=\"150\"/\u003e\n\u003c/a\u003e\n\n\u003e Allows Express usage with Azure Function\n\n[![npm version](https://img.shields.io/npm/v/azure-function-express.svg)](https://www.npmjs.com/package/azure-function-express)\n[![Node](https://img.shields.io/badge/node-v6-blue.svg)](https://github.com/Azure/azure-webjobs-sdk-script/issues/2036#issuecomment-336942961)\n![Node](https://img.shields.io/badge/node-v8-blue.svg)\n![Node](https://img.shields.io/badge/node-v10-blue.svg)\n[![Travis Status](https://img.shields.io/travis/yvele/azure-function-express/master.svg?label=travis)](https://travis-ci.org/yvele/azure-function-express)\n[![Coverage Status](https://img.shields.io/codecov/c/github/yvele/azure-function-express/master.svg)](https://codecov.io/github/yvele/azure-function-express)\n[![MIT licensed](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n\n## Description\n\n[Connect](https://github.com/senchalabs/connect) your [Express](https://expressjs.com) application to an [Azure Function handler](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node), and make seamless usage of [all middlewares](http://expressjs.com/en/guide/using-middleware.html) you are already familiar with.\n\n\n## Usage\n\nIn your `index.js`:\n\n```js\nconst createHandler = require(\"azure-function-express\").createHandler;\nconst express = require(\"express\");\n\n// Create express app as usual\nconst app = express();\napp.get(\"/api/:foo/:bar\", (req, res) =\u003e {\n  res.json({\n    foo  : req.params.foo,\n    bar  : req.params.bar\n  });\n});\n\n// Binds the express app to an Azure Function handler\nmodule.exports = createHandler(app);\n```\n\nMake sure you are binding `req` and `res` in your `function.json`:\n\n```json\n{\n  \"bindings\": [{\n    \"authLevel\" : \"anonymous\",\n    \"type\"      : \"httpTrigger\",\n    \"direction\" : \"in\",\n    \"name\"      : \"req\",\n    \"route\"     : \"foo/{bar}/{id}\"\n  }, {\n    \"type\"      : \"http\",\n    \"direction\" : \"out\",\n    \"name\"      : \"res\"\n  }]\n}\n```\n\nTo allow Express handles all HTTP routes itself you may set a glob star route in a single root `function.json`:\n\n```json\n{\n  \"bindings\": [{\n    \"authLevel\" : \"anonymous\",\n    \"type\"      : \"httpTrigger\",\n    \"direction\" : \"in\",\n    \"name\"      : \"req\",\n    \"route\"     : \"{*segments}\"\n  }, {\n    \"type\"      : \"http\",\n    \"direction\" : \"out\",\n    \"name\"      : \"res\"\n  }]\n}\n```\n\nNote that `segments` is not used and could be anything. See [Azure Function documentation](https://github.com/Azure/azure-webjobs-sdk-script/wiki/Http-Functions).\n\nAll examples [here](/examples/).\n\n\n## Context\n\nAll native Azure Functions [context](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node#context-object) properties, except `done`, are exposed through `req.context`.\n\nAs en example, you can [log](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node#writing-trace-output-to-the-console) using:\n\n```js\napp.get(\"/api/hello-world\", (req, res) =\u003e {\n  req.context.log({ hello: \"world\" });\n  ...\n});\n```\n\n\n## Runtime compatibility\n\nSupported Node version are:\n - Node 6.11.2 ([first node version supported by Azure Functions](https://github.com/Azure/azure-webjobs-sdk-script/issues/2036#issuecomment-336942961))\n - Node 8 (LTS)\n - Node 10\n\nAzure Functions runtime v1 and v2 beta are both supported.\n\n\n## License\n\n[Apache 2.0](LICENSE) © Yves Merlicco\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvele%2Fazure-function-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyvele%2Fazure-function-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvele%2Fazure-function-express/lists"}