Skip to content

Commit

Permalink
Merge pull request #31 from KacperFKorban/docstring
Browse files Browse the repository at this point in the history
Add docstring to guinep.web
  • Loading branch information
KacperFKorban authored Mar 20, 2024
2 parents 742883d + bf5aee6 commit ecbc18b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions web/src/main/scala/api.scala
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit ecbc18b

Please sign in to comment.