-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.hs
38 lines (31 loc) · 1.14 KB
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import "base" Control.Monad.IO.Class (liftIO)
import "warp" Network.Wai.Handler.Warp (run)
import "servant-server" Servant.Server
import "azure-managedapp-notifications" Azure.ManagedApp.Notifications.API
import "azure-managedapp-notifications" Azure.ManagedApp.Notifications.Types
handler :: Maybe String
-- ^ Optional Parameter
-> Notification
-- ^ Notification
-> Handler ()
handler mParam notification@ServiceCatalogNotification{..} = do
liftIO $ print "----------------------------"
liftIO $ print "Implement your handler here"
liftIO $ print notification
return ()
handler mParam notification@AzureMarketplaceNotification{..} = do
liftIO $ print "----------------------------"
liftIO $ print "Implement your handler here"
liftIO $ print notification
return ()
server :: Server NotificationsAPI
server = handler
app :: Application
app = serve notificationsAPI server
main :: IO ()
main = do
run 8080 app