Hi,
These files are not accessible via URL (unless you upload a txt file via media manger, then it’ll get an auto-URL, but you can’t set the url).
sometimes I use
// backend/serve-files.jsw
export function readFile(filePath){
//for example, filePath = 'backend/directoryname/file.txt'
const fs = require('fs');
return fs.readFileSync(require.resolve(filePath)).toString();
}
to read the contents of a file in a known directory path.
You probably can use it in a jsw file
Just import the function to the front end and use it.
(with some adjustment you can read js files and not only txt files)
Maybe there’re simpler ways (I never needed it on the frontend, so I never tried).