diff --git a/questionservice/question-service.js b/questionservice/question-service.js index 6dcfccca..0b95ba1a 100644 --- a/questionservice/question-service.js +++ b/questionservice/question-service.js @@ -37,7 +37,7 @@ app.post('/addquestion', async (req, res) => { // Guarda la nueva pregunta en la base de datos const savedQuestion = await newQuestion.save(); - res.status(1).json(savedQuestion); + res.status(201).json(savedQuestion); } catch (error) { res.status(500).json({ error: 'Internal Server Error' }); } @@ -54,4 +54,4 @@ server.on('close', () => { mongoose.connection.close(); }); -module.exports = server; \ No newline at end of file +module.exports = server;