curl --request POST \
--url https://api.example.com/usuarios \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"id": 123,
"email": "<string>",
"password": "<string>"
}Create a new user in the system with email and password
curl --request POST \
--url https://api.example.com/usuarios \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"id": 123,
"email": "<string>",
"password": "<string>"
}This endpoint creates a new user account in the PostgreSQL database using Prisma ORM. The user data is stored with the provided email and password.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Celaya55/app-cr/llms.txt
Use this file to discover all available pages before exploring further.
POST /usuarios
curl -X POST http://localhost:3000/usuarios \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securePassword123"
}'
{
"id": 1,
"email": "user@example.com",
"password": "securePassword123"
}
{
"error": "Error al insertar en Postgres"
}
/backend/index.js:24-36):
app.post('/usuarios', async (req, res) => {
try {
const nuevoUsuario = await prisma.user.create({
data: {
email: req.body.email,
password: req.body.password
}
});
res.status(201).json(nuevoUsuario);
} catch (error) {
console.log("DETALLE DEL ERROR:", error);
res.status(500).json({ error: "Error al insertar en Postgres" });
}
});