Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
788 B
1
Indexable
Never
const express = require('express');
const app = express();
const PORT = 2000;
app.use(express.json());


app.post("/appsegura/register", (req, res)=> {
    const {name, lastName, email, age, pass} = req.body;
    let user = {};
    user.name = name;
    user.lastName = lastName;
    user.email = email;
    user.age = age;
    user.pass = pass;

    if( user.name != "undefined" && 
        user.lastName != "undefined" &&
        user.email != "undefined" &&
        user.age != "undefined" && 
        user.pass != "undefined" ){
            res.status(200).send( {msg: "usuario creado", user: user});
    }

    res.status(401).send({msg: "por favor , verifique los datos ingresados"})
});

app.listen(PORT, () => {
    console.log("running Appsegura");
})