meteor app: images not loading

前端 未结 5 916
醉话见心
醉话见心 2020-12-16 22:50

I\'m making a simple chat app with meteor. My HTML is:


    

tomomi-chat

相关标签:
5条回答
  • 2020-12-16 23:13

    You should create a folder named public in your application root folder.

    From the Meteor documentation:

    /public

    Files in /public are served to the client as-is. Use this to store assets such as images. For example, if you have an image located at /public/background.png, you can include it in your HTML with or in your CSS with background-image: url(/background.png). Note that /public is not part of the image URL.

    0 讨论(0)
  • 2020-12-16 23:15

    To elaborate on this, I would add images asset directory in the public folder like this and serve it via like this

    images/transparent.jpg

    0 讨论(0)
  • 2020-12-16 23:15

    Create a /public folder. put your images there.

    0 讨论(0)
  • 2020-12-16 23:21

    Put assets in PROJECT/public folder and when you specify link in tag, just use "xyz.jpg".

    Thats it! The URL does not include /public folder in it. It is very very taken correctly by meteor framework.

    CORRECT -> "xyz.jpg"

    INCORRECT -> "/public/xyz.jpg"

    0 讨论(0)
  • 2020-12-16 23:38

    If you are Windows 10 user make public folder like that and call it in simple way

    enter image description here

    enter image description here

    0 讨论(0)
提交回复
热议问题