mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-25 16:19:44 +02:00
Use absolute paths for uploads and db (#168)
* Use absolute paths for uploads and db * Fix name interference * Add error on auth page * remove space * Support of separated upload folder with absolute path * fix files uploading * remove log * fix comment Co-authored-by: n0str <team@codex.so> Co-authored-by: Nikita Melnikov <nikmel2803@gmail.com>
This commit is contained in:
parent
331d45bf73
commit
836aa8985e
9 changed files with 29 additions and 9 deletions
|
@ -77,10 +77,17 @@ router.post('/transport/image', imageUploader, async (req: Request, res: Respons
|
|||
return;
|
||||
}
|
||||
|
||||
const fileData = {
|
||||
...req.files.image[0],
|
||||
url: '/uploads/' + req.files.image[0].filename,
|
||||
};
|
||||
|
||||
console.log(fileData);
|
||||
|
||||
try {
|
||||
Object.assign(
|
||||
response,
|
||||
await Transport.save(req.files.image[0], req.body.map ? JSON.parse(req.body.map) : undefined)
|
||||
await Transport.save(fileData, req.body.map ? JSON.parse(req.body.map) : undefined)
|
||||
);
|
||||
|
||||
response.success = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue