Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "5.23.0",
"version": "5.24.0",
"description": "One foundation for multiple applications.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down
9 changes: 7 additions & 2 deletions src/applications/Http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ export class Http {
return server
}

public static async boot(options: HttpOptions & { isAWSLambda: true }): Promise<AWSLambdaHandler>
public static async boot(
options: HttpOptions & { isAWSLambda: true }
): Promise<AWSLambdaHandler>

public static async boot(options?: HttpOptions): Promise<ServerImpl>

/**
* Boot the Http application.
*/
public static async boot(options?: HttpOptions): Promise<ServerImpl | AWSLambdaHandler> {
public static async boot(
options?: HttpOptions
): Promise<ServerImpl | AWSLambdaHandler> {
options = Options.create(options, {
initOnly: false,
isAWSLambda: false,
Expand Down
7 changes: 6 additions & 1 deletion src/ignite/Ignite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {
import { Ioc } from '@athenna/ioc'
import { Cron } from '#src/applications/Cron'
import { Http } from '#src/applications/Http'
import type { ServerImpl } from '@athenna/http'
import { EnvHelper, Rc } from '@athenna/config'
import { isAbsolute, resolve } from 'node:path'
import type { ReplImpl } from '#src/repl/ReplImpl'
Expand All @@ -26,6 +27,7 @@ import { CommanderHandler } from '@athenna/artisan'
import { LoadHelper } from '#src/helpers/LoadHelper'
import { Log, LoggerProvider } from '@athenna/logger'
import { Repl as ReplApp } from '#src/applications/Repl'
import type { Handler as AWSLambdaHandler } from 'aws-lambda'
import { parse as semverParse, satisfies as semverSatisfies } from 'semver'
import { Is, Path, File, Module, Options, Macroable } from '@athenna/common'
import { NotSatisfiedNodeVersion } from '#src/exceptions/NotSatisfiedNodeVersion'
Expand Down Expand Up @@ -134,10 +136,13 @@ export class Ignite extends Macroable {
}
}

public async httpServer(options: HttpOptions & { isAWSLambda: true }): Promise<AWSLambdaHandler>
public async httpServer(options?: HttpOptions): Promise<ServerImpl>

/**
* Ignite the Http server application.
*/
public async httpServer(options?: HttpOptions) {
public async httpServer(options?: HttpOptions): Promise<ServerImpl | AWSLambdaHandler> {
try {
this.options.environments.push('http')

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/applications/HttpTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default class HttpTest {
Server.when('listen').resolve(undefined)

await Http.boot({ host: '::1' })

assert.calledOnceWith(Server.listen, { host: '::1', port: 3000 })
assert.calledWith(successMock, 'Http server started on ({yellow} localhost:3000)')
assert.calledWith(successMock, 'Kernel ({yellow} HttpKernel) successfully booted')
Expand Down
Loading