diff options
| author | LLLL Colonq <llll@colonq> | 2025-06-16 03:33:52 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-06-16 03:33:52 -0400 |
| commit | 7c3e41979478d6826f73a956a26c967aae1687a2 (patch) | |
| tree | 093f9e418f95046fb8eccc3ed0f4c3bdbe1417bf /fig-web/main | |
| parent | 0f8a0bf2c0dce27cb832896731e2047e07310ebc (diff) | |
fig-utils: Guile FFI
Diffstat (limited to 'fig-web/main')
| -rw-r--r-- | fig-web/main/Main.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fig-web/main/Main.hs b/fig-web/main/Main.hs index 909127e..b1cc006 100644 --- a/fig-web/main/Main.hs +++ b/fig-web/main/Main.hs @@ -8,6 +8,7 @@ import Options.Applicative import Fig.Web.Types import Fig.Web.Utils +import qualified Fig.Utils.FFI as FFI import qualified Fig.Web.Public as Public import qualified Fig.Web.Secure as Secure @@ -23,11 +24,13 @@ parseSecureOptions = do data Command = Public PublicOptions | Secure SecureOptions + | TestFFI parseCommand :: Parser Command parseCommand = hsubparser $ mconcat [ command "public" $ info (Public <$> parsePublicOptions) (progDesc "Launch the public web server") , command "secure" $ info (Secure <$> parseSecureOptions) (progDesc "Launch the private web server (intended to be run behind authentication proxy)") + , command "testffi" $ info (pure TestFFI) (progDesc "Test the FFI") ] data Opts = Opts @@ -55,3 +58,8 @@ main = do case opts.cmd of Public o -> Public.server o cfg (opts.busHost, opts.busPort) Secure o -> Secure.server o cfg (opts.busHost, opts.busPort) + TestFFI -> do + log "testing FFI" + res <- FFI.checkAnswer "(lambda (d) (define (loop) (loop)) (loop) (string-length d))" + "hello computer" + log $ "result: " <> tshow res |
