Accessing uploaded files outside the dist folder Angular 2 + - node.js

I have a folder outside of the Dist directory called uploads. This is where all files uploaded are stored. Namely image files.
I can not figure out how to access these files without them being in the Assets directory in the dist folder. Putting them in the dist folder is not an option here.
If I upload them directly into the dist folder it will work in prod, until I need to take the site down for maintenance, then the whole dist folder will be destroyed on rebuild, and subsequently all the uploads.
If I upload to the assets folder in the src, they won't be displayed because they are not in dist. I am extremely confused and not sure what to do.
The outline of the project is to have uploads ran through a Node.js back end, stored in a local directory called uploads, and then accessed from the dist folder.

Related

How can a (vue/vite) (node/express) share same .env and node_modules files and foolder structure?

How to make vue (npm init vue#latest) and node/express server/api in root folder in a way that there are no duplicate
folders and files, like node_modules, .env files, etc.
Plan is to build client(spa) to public folder inside server(api), so everything is neat!
Is that usual practice?
I tried usual approach to generate everything separately, but no success in telling vite to install dependencies in node_modules outside client folder.

.Net core bower_components folder missing in wwwroot directory

I have fresh .Net core web app and it's source code uploaded first time on production server with CICD of the same. It went successfully but when I run the web app, the UI and js files were missing. After much digging in, I found that bower_component folder is missing which includes necessary css and js files from wwwroot folder.
Can anybody tell me why it is not uploading bower_components to the wwwroot folder?
You need to modify your .csproj file to include bower_component folder.
You can read offical document first(Include files at publish time), then you can refer below posts.
Related posts(include files, not folder) can refer to:
1. Unable to find files located in my root project folder when hosted on Azure
2. .NET Core include folder in publish
3. How to copy a folder to output directory and keep its root folder? #2949
4. dotnet core publish: include/exclude dir in output

Files folder not showing in heroku

My folders
and my gitignore file
but my assets folder "data" is not uploading to heroku.
this is my ls in heroku console.
Why it is not uploading my asset folder. Also i don't want to upload my assets so I used neglected every pdf or image files.
It's possible that your folder contains only files which are ignored by your .gitignore. Empty folders are not automatically uploaded to github or heroku unless they contain "something." Try adding a simple .txt file, commit that change, and see if it works.

How to correctly setup folders / files in nodejs?

I am currently starting out in node.js and I am a bit confused with the folder/file setups. Let´s say I have a main folder where all my different projects are located, and those are folders too. Now where do I need to keep my node-modules folder? Also how about the package.json file, do I need that inside each project folder?
use npm init first
it will make a package.json file.
Install the dependencies which be stored in Node_modules folder
Now make a folder named Public
with subfolders assets, css, js, index.html -- the FrontEnd part

Brunch build tool: subfolders in the assets directory are not copied?

i'm trying to set up my first project using Brunch, and i'm having a small issue, i want brunch to copy all files and subfolders in assets/ to the public/ folder, but it only copies the files and ignores the subfolders and other files.
And another thing is that i might like to have a folder called styles with subfolders for images and fonts, and i want them to be copied to the same place but in the public/ folder, is that possible?
here is an example:
app/
-assets/ html files, some xml files and ico's too
-styles/
-scss/
-img/
-fonts/
-scripts/
-vendor/ js and css files.
target folder:
public/ all files from assets
-styles css from scss folder, and a css for vendor's css
-img
-fonts
-js vendor and app js files
Thanks ahead!
Brunch only handles assets inside assets folders by default. You can also create app/styles/assets subdirectory.
If you want to change this default behavior, it's possible to change config.conventions.assets.

Resources