daleal
daleal
NNuxt
Created by daleal on 5/14/2024 in #❓・help
Open a raw text file on server code without exposing it as a public asset
Hi! I am using Nuxt 3 and I have a very specific use case where I would like to have in my repository a text file that I would like to open and manipulate on the server. I have made this work only on development by using some fs and path tricks, but the file obviously doesn't get added to the peoduction bundle. Every suggestion I have found involves serving the file publicly, but I need this file to stay private. Is there a way to make all of this happen? Essentially I would need some kind of file system alias that points to the right place in development, includes the file so that the bundler knows to add that file to the bundle, and then point to the right place on the production build.
2 replies