Skip to content

Commit ce3706b

Browse files
committed
feat(JS): define a route handler for the /server.js route
1 parent 6d50f0a commit ce3706b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

server.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ app.get("/email", async (req, res) => {
4747
});
4848
});
4949

50+
51+
5052
app.get("/openai", async (req, res) => {
5153
console.log(req.query);
5254
try {
@@ -102,6 +104,20 @@ app.get("/openai", async (req, res) => {
102104
}
103105
});
104106

107+
108+
109+
app.post("/server.js", (req, res) => {
110+
const dishCountry = req.body.recipe_country_of_origin;
111+
const isUserLactoseIntolerant = req.body.is_lactose_intolerant;
112+
113+
114+
res.json({
115+
message: `Variables ${dishCountry} and ${isUserLactoseIntolerant} received successfully`,
116+
});
117+
});
118+
119+
120+
105121
app.use(express.static("public"));
106122
const port = process.env.PORT || 3000;
107123
app.listen(port, () => {

0 commit comments

Comments
 (0)