io-backend
io-backend copied to clipboard
[#175072065] EXPERIMENTAL: Start io-backend as Azure Function
| Warnings | |
|---|---|
| :warning: |
Please include a description of your PR changes. |
Affected stories
- ⚙️ #175072065: Considerare il porting del backend su function serverless
New dependencies added: @azure/functions, io-functions-commons and @types/mime.
@azure/functions
Author: Microsoft
Description: Azure Functions types for Typescript
Homepage: http://npmjs.com/package/@azure/functions
| Created | almost 2 years ago |
| Last Updated | 5 months ago |
| License | MIT |
| Maintainers | 5 |
| Releases | 7 |
| Keywords | azure-functions and typescript |
README
Type definitions for Azure Functions
This package contains type definitions for using TypeScript with Azure Functions.
These typings are for common objects that will be passed to your Azure Functions function code. Azure Functions supports TypeScript development, but does not support directly running TypeScript code without transpilation.
Read more on configuring entry points in your Azure Functions function app.
Install
Because this package only contains TypeScript type definitions, it should be saved under devDependencies.
npm install @azure/functions --save-dev
Usage
import { AzureFunction, Context, HttpRequest } from "@azure/functions";
const index: AzureFunction = async function (context: Context, req: HttpRequest) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.query.name || (req.body && req.body.name)) {
context.res = {
status: "200",
body: "Hello " + (req.query.name || req.body.name)
};
} else {
context.res = {
status: 400,
body: "Please pass a name on the query string or in the request body"
};
}
}
export { index };
Versions
Versioning of @azure/functions is tied to the version of the Azure Functions Node.js Worker the types were generated from. You can find the Azure Functions Node.js Worker version of a given Function Runtime Version here. It is recommended that you take the latest version available.
Getting Started with Azure Functions
If you are getting started with Azure Functions, you can follow this tutorial to create and deploy your first JavaScript function. We recommend that you use Visual Studio Code and the Azure Functions extension.
The Azure Functions developer guide and the JavaScript-specific developer guide are good resources to gain an understanding of more Azure Functions concepts.
io-functions-commons
Author: https://www.pagopa.gov.it
Description: Common code for Azure functions
Homepage: https://github.com/pagopa/io-functions-commons#readme
| Created | over 1 year ago |
| Last Updated | 4 days ago |
| License | MIT |
| Maintainers | 4 |
| Releases | 88 |
| Direct Dependencies | @azure/cosmos, applicationinsights, azure-storage, cidr-matcher, fp-ts, helmet, helmet-csp, io-functions-express, io-ts, italia-ts-commons, node-fetch, nodemailer, nodemailer-sendgrid, referrer-policy, rehype-stringify, remark-frontmatter, remark-parse, remark-rehype, request-ip, ulid, unified and winston |
README
io-functions-commons
Common code across Azure functions of project IO.
To release a new package on GitHub and npm:
yarn release-it <minor|major|patch>
Upgrading from 13.x to 14.x
Version 14.x is the first version that uses italia-utils 5.x, a major upgrade to the package that generates the provided Typescript definitions.
This translates in the fact that you must upgrade italia-utils to a version >= 5.x if you want to upgrade your deps using io-functions-common 14.x.
@types/mime
Author: Unknown
Description: TypeScript definitions for mime
Homepage: http://npmjs.com/package/@types/mime
| Created | over 4 years ago |
| Last Updated | about 2 months ago |
| License | MIT |
| Maintainers | 1 |
| Releases | 17 |
| Direct Dependencies |
README
Installation
npm install --save @types/mime
Summary
This package contains type definitions for mime (https://github.com/broofa/node-mime).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime.
Additional Details
- Last updated: Wed, 22 Jul 2020 18:12:53 GMT
- Dependencies: none
- Global values:
mime,mimelite
Credits
These definitions were written by Jeff Goddard, and Daniel Hritzkiv.
Generated by :no_entry_sign: dangerJS
Codecov Report
Merging #722 (94282ce) into master (7e1db7b) will decrease coverage by
0.54%. The diff coverage is35.71%.
@@ Coverage Diff @@
## master #722 +/- ##
==========================================
- Coverage 79.67% 79.13% -0.55%
==========================================
Files 68 68
Lines 2298 2320 +22
Branches 375 375
==========================================
+ Hits 1831 1836 +5
- Misses 454 471 +17
Partials 13 13
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/server.ts | 0.00% <ø> (ø) |
|
| src/app.ts | 88.46% <28.00%> (-7.30%) |
:arrow_down: |
| src/controllers/authenticationController.ts | 95.09% <100.00%> (ø) |
|
| src/types/user.ts | 89.33% <100.00%> (ø) |
|
| src/controllers/sessionLockController.ts | 100.00% <0.00%> (+3.33%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 0fa3c70...d7312f2. Read the comment docs.