Untitled

 avatar
unknown
plain_text
5 months ago
469 B
5
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