minor directory name change and update to docs

This commit is contained in:
2026-01-27 17:53:36 -07:00
parent 915d8013aa
commit c446674432
7 changed files with 15 additions and 7 deletions
+31
View File
@@ -0,0 +1,31 @@
import express from "express";
import cors from "cors";
import postmark from "postmark";
import * as dotenv from 'dotenv';
dotenv.config();
const app = express();
const port = 3001; // Example port
const apiKey = process.env.API_KEY;
const client = new postmark.ServerClient(apiKey);
app.use(cors());
app.use(express.json()); // Parse incoming JSON data
// Example API endpoint
app.post("/api/send-email", (req, res) => {
const email = {
From: "contact@joshashton.dev",
To: "me@joshashton.dev",
Subject: req.body.name + " - " + req.body.emailAddress,
TextBody: req.body.message,
MessageStream: "outbound",
};
client.sendEmail(email);
res.json({ text: "email sent!" });
});
app.listen(port, () => {
console.log(`Server listening on port ${port}`);
});