Skip to content

Commit e4432ee

Browse files
committed
chore(http): create AWSLambdaHandler type
1 parent 343a74c commit e4432ee

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/core",
3-
"version": "5.24.0",
3+
"version": "5.25.0",
44
"description": "One foundation for multiple applications.",
55
"license": "MIT",
66
"author": "João Lenon <[email protected]>",

src/applications/Http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Log } from '@athenna/logger'
1212
import type { ServerImpl } from '@athenna/http'
1313
import type { HttpOptions } from '#src/types/HttpOptions'
1414
import { Is, Path, Module, Options } from '@athenna/common'
15-
import type { Handler as AWSLambdaHandler } from 'aws-lambda'
15+
import type { AWSLambdaHandler } from '#src/types/AWSLambdaHandler'
1616

1717
export class Http {
1818
/**

src/ignite/Ignite.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { CommanderHandler } from '@athenna/artisan'
2727
import { LoadHelper } from '#src/helpers/LoadHelper'
2828
import { Log, LoggerProvider } from '@athenna/logger'
2929
import { Repl as ReplApp } from '#src/applications/Repl'
30-
import type { Handler as AWSLambdaHandler } from 'aws-lambda'
30+
import type { AWSLambdaHandler } from '#src/types/AWSLambdaHandler'
3131
import { parse as semverParse, satisfies as semverSatisfies } from 'semver'
3232
import { Is, Path, File, Module, Options, Macroable } from '@athenna/common'
3333
import { NotSatisfiedNodeVersion } from '#src/exceptions/NotSatisfiedNodeVersion'
@@ -136,13 +136,18 @@ export class Ignite extends Macroable {
136136
}
137137
}
138138

139-
public async httpServer(options: HttpOptions & { isAWSLambda: true }): Promise<AWSLambdaHandler>
139+
public async httpServer(
140+
options: HttpOptions & { isAWSLambda: true }
141+
): Promise<AWSLambdaHandler>
142+
140143
public async httpServer(options?: HttpOptions): Promise<ServerImpl>
141144

142145
/**
143146
* Ignite the Http server application.
144147
*/
145-
public async httpServer(options?: HttpOptions): Promise<ServerImpl | AWSLambdaHandler> {
148+
public async httpServer(
149+
options?: HttpOptions
150+
): Promise<ServerImpl | AWSLambdaHandler> {
146151
try {
147152
this.options.environments.push('http')
148153

src/types/AWSLambdaHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { Handler } from 'aws-lambda'
2+
3+
export type AWSLambdaHandler = Handler

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ export * from '#src/types/CronOptions'
1313
export * from '#src/types/HttpOptions'
1414
export * from '#src/types/IgniteOptions'
1515
export * from '#src/types/ConsoleOptions'
16+
export * from '#src/types/AWSLambdaHandler'

0 commit comments

Comments
 (0)