From 210fd6992aa838f745512e5c36e1538361079f90 Mon Sep 17 00:00:00 2001 From: ljourm Date: Tue, 14 Mar 2023 01:56:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20lambda-api=E3=82=92=E6=9C=80=E4=BD=8E?= =?UTF-8?q?=E9=99=90=E3=81=A7=E5=B0=8E=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/handler.js b/handler.js index 689bd05..995f72d 100644 --- a/handler.js +++ b/handler.js @@ -1,7 +1,9 @@ +const api = require("lambda-api")(); + +api.get("/status", async (req, res) => { + return { status: "ok" }; +}); + exports.router = async (event, context, callback) => { - return { - statusCode: 200, - headers: {}, - body: JSON.stringify({ message: "hello world" }), - }; + return await api.run(event, context); };