Untitled
unknown
plain_text
a year ago
469 B
9
Indexable
app.post('/workout', (req, res) => {
const { exercise, weight, reps } = req.body;
if (!exercise || !weight || !reps) {
return res.status(400).json({ error: 'Missing required fields' });
}
// Process the workout data (e.g., save to database)
const workoutData = { exercise, weight, reps };
// For demonstration, we'll just send the data back
res.status(201).json({
message: 'Workout data received successfully',
data: workoutData
});
});Editor is loading...
Leave a Comment