Skip to content

Commit

Permalink
feat(docs): different paths for env file
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Aug 14, 2023
1 parent 5da610b commit 857337a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/getting-started/athennarc-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ also register it inside your `.athennarc.json` file:
}
```

## Custom RC file name
## Custom RC file path

You can change the name and the path of your RC file or even
create customized ones for each environement (`.athennarc.dev.json`,
Expand All @@ -62,7 +62,8 @@ await ignite.httpServer()
:::tip

Always remember that when using relative paths to set something
in Athenna, you need to use your project root path as reference.
in Athenna, you need to use your project root path as reference,
just like in the example above.

:::

Expand Down
23 changes: 23 additions & 0 deletions docs/getting-started/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,29 @@ APP_URL=http://${HOST}:${PORT}
console.log(Env('APP_URL')) // "http://localhost:3000"
```

## Custom environment file path

You can also change the name and the path of your `.env` file.
To do that you need to set the new path to `Ignite.load()` method:

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

const ignite = await new Ignite().load(import.meta.url, {
envPath: './bootstrap/.env.dev' 👈
})

await ignite.httpServer()
```

:::tip

Always remember that when using relative paths to set something
in Athenna, you need to use your project root path as reference,
just like in the example above.

:::

## Configuration files

All the configuration files for the Athenna framework are
Expand Down

0 comments on commit 857337a

Please sign in to comment.