From a2ad0b07491fee0fbfb5bf725334b6284b9b16d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez?= Date: Tue, 20 Aug 2024 12:07:52 +0200 Subject: [PATCH] add healthcheck endpoint --- packages/backend/index.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/backend/index.js b/packages/backend/index.js index 7720dd1..2e1ade5 100644 --- a/packages/backend/index.js +++ b/packages/backend/index.js @@ -19,18 +19,6 @@ const { trackPlausibleEvent } = require("./services/plausible"); const app = express(); const autogradingEnabled = process.env.NODE_ENV !== "test" && !!process.env.AUTOGRADING_SERVER; -/* - Uncomment this if you want to create a wallet to send ETH or something... -const INFURA = JSON.parse(fs.readFileSync("./infura.txt").toString().trim()) -const PK = fs.readFileSync("./pk.txt").toString().trim() -let wallet = new ethers.Wallet(PK,new ethers.providers.InfuraProvider("goerli",INFURA)) -console.log(wallet.address) -const checkWalletBalance = async ()=>{ - console.log("BALANCE:",ethers.utils.formatEther(await wallet.provider.getBalance(wallet.address))) -} -checkWalletBalance() -*/ - app.use(cors()); app.use(bodyParser.json()); @@ -40,6 +28,10 @@ app.use("/events", eventsRoutes); app.use("/builds", buildsRoutes); app.use("/bg", bgRoutes); +app.get("/healthcheck", (_, res) => { + res.status(200).send("ok"); +}); + app.get("/sign-message", (req, res) => { const messageId = req.query.messageId ?? "login"; const options = req.query;