this time maybe actually do it right?

This commit is contained in:
hippoz 2020-10-18 19:40:30 +03:00
parent e4f20290fe
commit 6001a52acc
2 changed files with 2 additions and 2 deletions

View file

@ -139,7 +139,7 @@ app.post('/api/upload', [ cors(corsOptions) ], (req, res) => {
} else if(err.code === 'ENOENT') {
file.mv(filepath, (err) => {
if (err) return res.status(500).render('uploadfailed', { message: 'something went wrong while uploading the file.' });
res.render('uploaded', { file: { name: chosenFileName }, config: { url: config.url } });
res.render('uploaded', { file: { name: chosenFileName }, baseurl: config.url });
});
} else {
return res.status(500).render('uploadfailed', { message: 'something went wrong.' });;

View file

@ -9,6 +9,6 @@
<h1>the file was uploaded</h1>
<p>i think</p>
<br>
<a href="<%= config.url %>/file/<%= file.name %>">go to file</a>
<a href="<%= baseurl %>/file/<%= file.name %>">go to file</a>
</body>
</html>