@nestjs/azure-func-http
Advanced tools
Comparing version 0.2.0 to 0.3.1
@@ -6,3 +6,4 @@ import { Context, HttpRequest } from '@azure/functions'; | ||
private createHandler; | ||
private hasGetTypeMethod; | ||
} | ||
export declare const AzureHttpAdapter: AzureHttpAdapterStatic; |
@@ -23,2 +23,6 @@ "use strict"; | ||
const app = yield createApp(); | ||
const adapter = app.getHttpAdapter(); | ||
if (this.hasGetTypeMethod(adapter) && adapter.getType() === 'azure-http') { | ||
return adapter.handle.bind(adapter); | ||
} | ||
const instance = app.getHttpAdapter().getInstance(); | ||
@@ -29,4 +33,7 @@ handler = azure_function_express_1.createHandler(instance); | ||
} | ||
hasGetTypeMethod(adapter) { | ||
return !!adapter.getType; | ||
} | ||
} | ||
exports.AzureHttpAdapterStatic = AzureHttpAdapterStatic; | ||
exports.AzureHttpAdapter = new AzureHttpAdapterStatic(); |
export * from './azure-http.adapter'; | ||
export * from './router'; |
@@ -7,1 +7,2 @@ "use strict"; | ||
__export(require("./azure-http.adapter")); | ||
__export(require("./router")); |
{ | ||
"name": "@nestjs/azure-func-http", | ||
"version": "0.2.0", | ||
"version": "0.3.1", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@azure-func-http)", | ||
@@ -24,15 +24,17 @@ "author": "Kamil Mysliwiec", | ||
"@azure/functions": "1.0.3", | ||
"@nestjs/common": "6.6.0", | ||
"@nestjs/core": "6.6.0", | ||
"@types/node": "11.13.19", | ||
"husky": "3.0.4", | ||
"lint-staged": "9.2.5", | ||
"@nestjs/common": "6.8.5", | ||
"@nestjs/core": "6.8.5", | ||
"@types/node": "11.15.0", | ||
"husky": "3.0.9", | ||
"lint-staged": "9.4.2", | ||
"prettier": "1.18.2", | ||
"ts-morph": "3.1.3", | ||
"typescript": "3.5.3" | ||
"ts-morph": "4.3.2", | ||
"typescript": "3.6.4" | ||
}, | ||
"dependencies": { | ||
"@angular-devkit/schematics": "8.3.1", | ||
"@schematics/angular": "8.3.1", | ||
"azure-function-express": "2.0.0" | ||
"@angular-devkit/schematics": "8.3.15", | ||
"@schematics/angular": "8.3.15", | ||
"azure-function-express": "2.0.0", | ||
"cors": "2.8.5", | ||
"trouter": "3.1.0" | ||
}, | ||
@@ -39,0 +41,0 @@ "schematics": "./schematics/collection.json", |
@@ -43,2 +43,12 @@ <p align="center"> | ||
## Native routing | ||
If you don't need the compatibility with `express` library, you can use a native routing instead: | ||
```typescript | ||
const app = await NestFactory.create(AppModule, new AzureHttpRouter()); | ||
``` | ||
`AzureHttpRouter` is exported from `@nestjs/azure-func-http`. Since `AzureHttpRouter` doesn't use `express` underneath, the routing itself is much faster. | ||
## Additional options | ||
@@ -64,5 +74,5 @@ | ||
* Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) | ||
* Website - [https://nestjs.com](https://nestjs.com/) | ||
* Twitter - [@nestframework](https://twitter.com/nestframework) | ||
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) | ||
- Website - [https://nestjs.com](https://nestjs.com/) | ||
- Twitter - [@nestframework](https://twitter.com/nestframework) | ||
@@ -69,0 +79,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34651
35
393
80
8
1
+ Addedcors@2.8.5
+ Addedtrouter@3.1.0
+ Added@angular-devkit/core@8.3.15(transitive)
+ Added@angular-devkit/schematics@8.3.15(transitive)
+ Added@schematics/angular@8.3.15(transitive)
+ Addedcors@2.8.5(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedregexparam@1.3.0(transitive)
+ Addedtrouter@3.1.0(transitive)
+ Addedvary@1.1.2(transitive)
- Removed@angular-devkit/core@8.3.1(transitive)
- Removed@angular-devkit/schematics@8.3.1(transitive)
- Removed@schematics/angular@8.3.1(transitive)
Updated@schematics/angular@8.3.15