publishing

This commit is contained in:
Nicholas Keller
2026-07-28 10:56:50 -04:00
parent dac9969507
commit a47eb13b62
12 changed files with 148 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import express from "express"
import { newIdeaSchema, validateSchema } from "./schemas";
import newIdeaHandler from "./handlers/newIdea";
import getIdeasHandler from "./handlers/getIdeas";
import previewIdeasHandler from "./handlers/previewIdeas";
const spark = express();
spark.use(express.json());
spark.post("/idea", validateSchema(newIdeaSchema), newIdeaHandler);
spark.get("/idea", getIdeasHandler);
spark.get("/idea/preview", previewIdeasHandler);
const PORT: number = Number(process.env.SPARK_PORT || 7654);
spark.listen(PORT, () => {
console.log(`Listening on port ${PORT}`)
})