Adrian Krebs
Adrian Krebs

Reputation: 4387

Not allowed to load local resource meteor app

I want to add a background image to my meteor webapp:

background: url('../public/img/car.jpg') no-repeat center center fixed;

But then I get the following error message:

jquery.js?hash=c334cf5…:3662 Not allowed to load local resource: file:///D:/project/app/public/car.jpg

What am I missing?

Upvotes: 0

Views: 435

Answers (2)

Adrian Krebs
Adrian Krebs

Reputation: 4387

I finally found the answer here: meteor app: images not loading

Files in /public are served to the client as-is

So I had to exclude the file path and just type /car.png

Upvotes: 0

Christian Fritz
Christian Fritz

Reputation: 21374

I think you might be misunderstanding the use of the public folder (see the doc on directory structure). Anything in that folder will be served statically on the / URL. So I think all you need to change is this:

background: url('/img/car.jpg') no-repeat center center fixed;

Upvotes: 1

Related Questions