Skip to content

Commit

Permalink
add healthcheck endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
carletex committed Aug 20, 2024
1 parent ced9cc0 commit a2ad0b0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions packages/backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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;
Expand Down

0 comments on commit a2ad0b0

Please sign in to comment.