{"title":"Hello World","description":"","section":"cookbook","version":"v1.5","path":"cookbook/hello-world","canonical_url":"https://amberframework.org/docs/v1.5/cookbook/hello-world","markdown_url":"https://amberframework.org/docs/v1.5/cookbook/hello-world.md","inherited":true,"content_markdown":"# Hello World\n\nThis recipe will help you to setup a `Hello World!` response in your `/hello` path.\n\n{% hint style=\"warning\" %}\nFirst you need an amber project generated with [Amber CLI](../guides/create-new-app.md) or [from scratch](from-scratch.md).\n{% endhint %}\n\nFirst create a `src/controllers/hello_controller.cr` file and add this:\n\n{% code-tabs %}\n{% code-tabs-item title=\"src/controllers/hello\\_controller.cr\" %}\n```crystal\nclass HelloController < ApplicationController\n  def hello\n    \"Hello Amber!\"\n  end\nend\n```\n{% endcode-tabs-item %}\n{% endcode-tabs %}\n\nThen add a new route in your `config/routes.cr` file:\n\n```crystal\nAmber::Server.configure do |app|\n  pipeline :web do\n    # pipelines...\n  end\n\n  routes :web do\n    # other routes,,,\n    get \"/hello\", HelloController, :hello\n  end\nend\n```"}