Last active
September 18, 2018 21:12
-
-
Save AJ92/d3b777b1e1e96aa8717e770961fd6c57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//register.ts | |
export class Register { | |
validateEmail(email){ | |
return false; | |
} | |
onPostCheckMail (req, res) { | |
if(this.validateEmail(req.body.email) === true){ //validateEmail is undefined | |
res.end("available"); | |
return; | |
} | |
res.end("taken"); | |
} | |
} | |
//index.ts | |
let register = new Register(db); | |
app.use(bodyParser.urlencoded({ extended: false })); | |
app.use(bodyParser.json()); | |
app.use(express.json()); | |
app.post('/checkemailp', register.onPostCheckMail); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment