Skip to content

Commit

Permalink
feat(docs): safe load configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Aug 14, 2023
1 parent 857337a commit 358e0d4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/getting-started/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,29 @@ check [the do your own structure documentation section](https://athenna.io/docs/
for more information about how to create your own project
structure.

## Safe loading configuration files

Athenna got multiple types of applications, while using the framework
you will notice that some times you could end up igniting your application
twice. Let's suppose you are using `./node artisan serve` command to start
your application, this command will first ignite your application by Artisan
and them by the HTTP server.

This is usually not a problem at all, but depending on how you have created
your environment it could become one. To avoid reloading configuration
files in these situations, you can set the `loadConfigSafe` option as `true`
in `Ignite.load()` method:

```typescript filename="bootstrap/main.ts"
import { Ignite } from '@athenna/core'

const ignite = await new Ignite().load(import.meta.url, {
loadConfigSafe: true, 👈
})

await ignite.httpServer()
```

## Debug mode

The `debug` option in your `Path.config('app.ts')` configuration
Expand Down

0 comments on commit 358e0d4

Please sign in to comment.