-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
import AWS.Lambda.Runtime (mRuntime) | ||
import qualified Data.Aeson as A | ||
import AWS.Lambda.Runtime (mRuntime) | ||
import qualified Data.Aeson as A | ||
import qualified Network.Wai.Handler.Hal as WaiHandler | ||
import System.Environment (lookupEnv) | ||
import qualified Zureg.Hackathon | ||
import qualified Zureg.Main.Janitor | ||
import qualified Zureg.Main.Web as Web | ||
|
||
main :: IO () | ||
main = mRuntime $ \(_ :: A.Value) -> | ||
Zureg.Hackathon.withHackathonFromEnv Zureg.Main.Janitor.main | ||
main = do | ||
handler <- lookupEnv "_HANDLER" | ||
case handler of | ||
Just "janitor" -> mRuntime $ \(_ :: A.Value) -> | ||
Zureg.Hackathon.withHackathonFromEnv Zureg.Main.Janitor.main | ||
_ -> do | ||
app <- Zureg.Hackathon.withHackathonFromEnv Web.app | ||
mRuntime $ WaiHandler.run app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters