diff --git a/index.js b/index.js index bf91a1e..6337bd5 100644 --- a/index.js +++ b/index.js @@ -48,8 +48,10 @@ app.post("/register", (req, res) => { } else { User.create({name: req.body.name, email: req.body.email, password: req.body.password1}, (err, done) => { if (err) { + res.status(400); res.render("error", {message: "error"}); } else { + res.status(200); res.render("index1"); } }); @@ -64,4 +66,4 @@ app.listen(process.env.PORT, (err) => { return; } console.log(`Server is up and running on http://localhost:${process.env.PORT}`); -}); \ No newline at end of file +}); diff --git a/views/index.ejs b/views/index.ejs index 4f6c146..edf86ff 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,6 +1,6 @@ <% include partials/header %> -