Skip to content

Commit

Permalink
fix: url in "custom_init_method" doc (felangel#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielRozendo committed Apr 5, 2023
1 parent 6d472ab commit 49cf03e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docs/advanced/custom_init_method.md
Expand Up @@ -5,14 +5,14 @@ title: 🛫 Custom Init Method

# Custom Init Method 🛫

Dart Frog supports creating a custom entrypoint as shown in the [Custom Entrypoint docs](docs/advanced/custom_entrypoint) but that will run every time the server hot reloads. In cases where you want to initialize something only on server start, like setting up a database connection, you can use the `init` method.
Dart Frog supports creating a custom entrypoint as shown in the [Custom Entrypoint docs](/docs/advanced/custom_entrypoint) but that will run every time the server hot reloads. In cases where you want to initialize something only on server start, like setting up a database connection, you can use the `init` method.

## Creating a Custom Init Method ✨

To create a custom init method, simply create a `main.dart` file at the root of your Dart Frog project.

:::warning
Keep in mind that the `main.dart` file must expose a top-level `run` as mentioned in the [Custom Entrypoint docs](docs/advanced/custom_entrypoint).
Keep in mind that the `main.dart` file must expose a top-level `run` as mentioned in the [Custom Entrypoint docs](/docs/advanced/custom_entrypoint).
:::

Add the following top-level `init` method to the `main.dart` file:
Expand Down

0 comments on commit 49cf03e

Please sign in to comment.