From 034d9c647e58e5574483b9f31a814e7c6617a67f Mon Sep 17 00:00:00 2001 From: Jamie Brown Date: Thu, 20 Feb 2020 11:33:58 +0000 Subject: [PATCH] add stage --- post.js | 7 ++++++- serverless.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/post.js b/post.js index d4be87e..035c0f4 100644 --- a/post.js +++ b/post.js @@ -172,5 +172,10 @@ exports.post = async function(event, context) { statusCode: 200, body: "success" }; - } catch (err) {} + } catch (err) { + return { + statusCode: 401, + body: "fail" + }; + } }; diff --git a/serverless.yml b/serverless.yml index b939a11..469f6f6 100644 --- a/serverless.yml +++ b/serverless.yml @@ -4,6 +4,7 @@ provider: name: aws runtime: nodejs12.x profile: csn + stage: ${opt:stage, 'dev'} environment: NODE_ENV: "${file(./serverless.env.yml):NODE_ENV}" SLACK_TOKEN: "${file(./serverless.env.yml):SLACK_TOKEN}"