Can't access a static file after building


#1

Hi,

I want to serve a log file that is created after build.
The behaviour I wanted is to be able to access the file as http://mydomain/logs/log.txt however I could only reach files this way if they were in /public directory. And I don’t know how to create the file in /public directory after building as there is no more “public” directory.

I used log4js as the following
Try 1: set the file path to “…/web.browser/app/logs/log.txt” and build
The file does get created when I run the build but I cannot reach it from the browser

Try 2: Create a dummy file inside the public folder “public/logs/log.txt” then set the same previous path
The file gets created, I get to access it (although it’s annoyingly caching and I must hard refresh to get the latest). But, sometimes I get an error when running the build saying that I have no permission to access the file “…/web.browser/app/logs/log.txt” but it’s random

How to properly do this? How can I create a file during the server runtime and then make it available for the client?

I’m using Meteor 1.6 and the client side is built with React (shouldn’t matter)

I tried searching for similar threads but I had no success, probably not the right keywords. :confused: