From 1f02e0af11c9a6477bcb7776379936e86da46908 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Wed, 3 Jul 2024 19:39:04 -0300 Subject: [PATCH] Document a bit more, move ping/ to the user's code --- examples/hello_crystal/funko.cr | 13 +++++++++++++ runtimes/crystal/main.cr | 4 ---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/hello_crystal/funko.cr b/examples/hello_crystal/funko.cr index 88ae85f..a397946 100644 --- a/examples/hello_crystal/funko.cr +++ b/examples/hello_crystal/funko.cr @@ -1,3 +1,16 @@ +require "kemal" + +# This is a kemal app, you can add handlers, middleware, etc. + +# A basic hello world get endpoint get "/" do "Hello World Crystal!" end + +# The `/ping/` endpoint is configured in the container as a healthcheck +# You can make it better by checking that your database is responding +# or whatever checks you think are important +# +get "/ping/" do + "OK" +end diff --git a/runtimes/crystal/main.cr b/runtimes/crystal/main.cr index 20c87cb..c8670e8 100644 --- a/runtimes/crystal/main.cr +++ b/runtimes/crystal/main.cr @@ -1,8 +1,4 @@ require "kemal" require "./funko.cr" -get "/ping/" do - "OK" -end - Kemal.run