this time maybe actually do it right?
This commit is contained in:
parent
e4f20290fe
commit
6001a52acc
2 changed files with 2 additions and 2 deletions
2
index.js
2
index.js
|
@ -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.' });;
|
||||
|
|
|
@ -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>
|
Loading…
Reference in a new issue