D
D
Denis2019-05-19 15:06:14
JavaScript
Denis, 2019-05-19 15:06:14

Where is the correct place to store Vuejs cli + NodeJs (MariaDB) upload images?

Where and how to architecturally save user-uploaded images in a Vue project (Vue CLI-3). There is a backend with an API based on NodeJS with a Mysql database in which, apparently, the names of the images will be saved, it is not clear where exactly the images themselves should be saved (the directory and where it should be).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
McBernar, 2019-05-19
@McBernar

On the node, you probably have Express? Make static files and store them there if they are not private files.

N
neatsoft, 2019-06-04
@neatsoft

From the point of view of The Twelve Factor App , a third-party backing service should be used to store user-uploaded media files. In most large projects this is Amazon S3 , but if you need to host all the data locally, you can install MinIO .
Relative paths are written to the database. Storage url and keys are set via environment variables.
Important! Static files (static assets) do not need to be placed in S3: this is wrong from an architectural point of view, because they are part of the application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question