diff --git a/Dockerfile b/Dockerfile index 6fb8607..a1bd1f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM node:20-alpine +RUN apk add --no-cache curl WORKDIR /app COPY package.json ./ RUN npm install --production diff --git a/server.js b/server.js index d8d7f1a..10da1d7 100644 --- a/server.js +++ b/server.js @@ -65,6 +65,10 @@ const smtp = new SMTPServer({ const app = express(); +app.get("/health", (_req, res) => { + res.json({ status: "ok", stored: store.size }); +}); + app.use((req, res, next) => { if (API_KEY && req.headers["x-api-key"] !== API_KEY) { return res.status(401).json({ error: "unauthorized" }); @@ -72,10 +76,6 @@ app.use((req, res, next) => { next(); }); -app.get("/health", (_req, res) => { - res.json({ status: "ok", stored: store.size }); -}); - app.get("/mail/:address", (req, res) => { const addr = req.params.address.toLowerCase(); const mails = store.get(addr) || [];