Create new app
Learn how to get started with Azu and build applications
Let's get a Azu application up and running as quickly as possible.
Before we begin, please take a minute to read the Installation Guide. By installing any necessary dependencies beforehand, we'll be able to get our application up and running smoothly.
Generate a Crystal App Project
We can run crystal init app my_app
from any directory in order to bootstrap our Azu application. Assuming that the name of our application is my_app
, let's run the following command:
Add the dependency to your shard.yml
shard.yml
Open your /my_app/shard.yml in your favorite editor and add the azu dependency
Azu is very light, flexible and module, for this reason it does not add front-end dependencies nor database dependencies. We will teach you how you can integrate those later in the guides
Run Shards Install
Now install Azu by running shards install
from the terminal
Enabling Azu in Your project
Now that you have install Azu, lets enable it in your project. Open /my_app/src/my_app.cr
With the simple include azu
you have unlocked the benefits of Azu for your project.
Available methods
Name | |
MyApp.configure | Accepts a block and allows you to define Azu configuration |
MyApp.log | This is the application logger and uses Crystal built in logger by default |
MyApp.env | Allows you to work with the application current environment Production, Development, Staging, etc. |
MyApp.config | Gets your application configuration for easy access from other parts of the code base |
MyApp.start | Starts the HTTP server |
Last updated