You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Air](https://github.com/cosmtrek/air) is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient.
36
+
37
+
To use Air in a Fiber project, follow these steps:
38
+
39
+
1. Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source.
40
+
2. Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber:
41
+
```toml
42
+
# .air.toml
43
+
root = "."
44
+
tmp_dir = "tmp"
45
+
[build]
46
+
cmd = "go build -o ./tmp/main ."
47
+
bin = "./tmp/main"
48
+
delay = 1000# ms
49
+
exclude_dir = ["assets", "tmp", "vendor"]
50
+
include_ext = ["go", "tpl", "tmpl", "html"]
51
+
exclude_regex = ["_test\\.go"]
52
+
```
53
+
3. Start your Fiber application using Air by running the following command in the terminal:
54
+
```sh
55
+
air
56
+
```
57
+
58
+
As you make changes to your source code, Air will detect them and automatically restart the application.
59
+
60
+
A complete example demonstrating the use of Air with Fiber can be found in the [Fiber Recipes repository](https://github.com/gofiber/recipes/tree/master/air). This example shows how to configure and use Air in a Fiber project to create an efficient development environment.
61
+
62
+
33
63
## How do I set up an error handler?
34
64
35
65
To override the default error handler, you can override the default when providing a [Config](../api/fiber.md#config) when initiating a new [Fiber instance](../api/fiber.md#new).
0 commit comments