Redirect to image after upload
This commit is contained in:
parent
db7eabaa67
commit
e30e92f9ce
1 changed files with 1 additions and 4 deletions
5
app.js
5
app.js
|
@ -69,10 +69,7 @@ app.use(morgan("dev"))
|
|||
res.render("index");
|
||||
})
|
||||
.post("/upload", isAuth, upload.single("image"), (req, res) => {
|
||||
if (req.body.image) {
|
||||
fs.writeFile("images/", data, options, callback)
|
||||
}
|
||||
res.redirect("/");
|
||||
res.redirect("/images/" + req.file.filename);
|
||||
})
|
||||
.get("/login", (req, res) => {
|
||||
let fail = false;
|
||||
|
|
Loading…
Reference in a new issue