From bf5aee6ee0ef147f03be501b758c282066805791 Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Wed, 20 Mar 2024 01:34:35 +0100 Subject: [PATCH] Add docstring to guinep.web --- web/src/main/scala/api.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/src/main/scala/api.scala b/web/src/main/scala/api.scala index bf8df8c..4fd8729 100644 --- a/web/src/main/scala/api.scala +++ b/web/src/main/scala/api.scala @@ -1,5 +1,16 @@ package guinep +/** + * Starts a web server with the endpoints for running the given functions and + * an automatically derived frontend for calling them. + * + * @param functions the functions to be exposed + * @example {{{ + * def add(a: Int, b: Int) = a + b + * def greet(name: String) = s"Hello, $name!" + * @main def run = guinep.web(add, greet) + * }}} + */ inline def web(inline functions: Any*): Unit = val functionsInfos = macros.funInfos(functions) val functionsInfosMap = functionsInfos.groupBy(_.name)