publishing
This commit is contained in:
@@ -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}`)
|
||||
})
|
||||
Reference in New Issue
Block a user