Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit d45e666

Browse files
authored
Merge pull request #342 from deckgo/nm-update-starter
infra: update deckdeckgo starter
2 parents 0e32f3c + 4001fbe commit d45e666

File tree

13 files changed

+584
-1635
lines changed

13 files changed

+584
-1635
lines changed

infra/default.nix

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ rec
77
cp ${pkgs.wai-lambda.wai-lambda-js-wrapper} main.js
88
# Can't be called 'main' otherwise lambda tries to load it
99
cp "${handler}/bin/handler" main_hs
10+
cp ${deckdeckgo-starter-dist}/dist.tar dist.tar
1011
mkdir $out
11-
${pkgs.zip}/bin/zip -r $out/function.zip main.js main_hs
12+
${pkgs.zip}/bin/zip -r $out/function.zip main.js main_hs dist.tar
1213
'';
1314

1415
# TODO: move all other builders to this
@@ -17,6 +18,7 @@ rec
1718
(builtins.readDir function) "${function}/function.zip";
1819
} ;
1920

21+
2022
function-unsplash =
2123
pkgs.runCommand "build-lambda" {}
2224
''
@@ -42,22 +44,6 @@ rec
4244
${pkgs.zip}/bin/zip -r $out/function.zip main.js main_hs
4345
'';
4446

45-
function-presenter-path =
46-
{ path = builtins.seq
47-
(builtins.readDir function-presenter) "${function-presenter}/function.zip";
48-
} ;
49-
50-
function-presenter =
51-
pkgs.runCommand "build-lambda-presenter" {}
52-
''
53-
cp ${pkgs.wai-lambda.wai-lambda-js-wrapper} main.js
54-
# Can't be called 'main' otherwise lambda tries to load it
55-
cp "${handler}/bin/presenter" main_hs
56-
cp ${deckdeckgo-starter-dist}/dist.tar dist.tar
57-
mkdir -p $out
58-
${pkgs.zip}/bin/zip -r $out/function.zip main.js main_hs dist.tar
59-
'';
60-
6147
function-dirty-path =
6248
{ path = builtins.seq
6349
(builtins.readDir function-dirty) "${function-dirty}/function.zip";
@@ -188,12 +174,6 @@ rec
188174

189175
publicKey = builtins.readFile ./public.cer;
190176

191-
swaggerUi = pkgs.runCommand "swagger-ui" {}
192-
''
193-
mkdir -p $out
194-
${handler}/bin/swagger $out
195-
'';
196-
197177
googleResp = { "key1" = publicKey ; };
198178

199179
apiDir = pkgs.writeTextFile

infra/dynamo.tf

Lines changed: 0 additions & 33 deletions
This file was deleted.

infra/handler/app/Handler.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ main = do
3535

3636
putStrLn "Connection acquired, starting lambda..."
3737

38-
Lambda.run $ cors $ DeckGo.Handler.application settings env conn
38+
Lambda.runSettings settings' $ cors $ DeckGo.Handler.application settings env conn
39+
where
40+
settings' = Lambda.defaultSettings
41+
{ Lambda.timeoutValue = 20 * 1000 * 1000 }
3942

4043
-- TODO: factor out
4144
getFirebaseSettings :: AWS.Env -> IO Firebase.FirebaseLoginSettings

infra/handler/app/Presenter.hs

Lines changed: 0 additions & 85 deletions
This file was deleted.

infra/handler/app/Swagger.hs

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)