Meteor public folder not working

后端 未结 3 1943
醉酒成梦
醉酒成梦 2021-02-05 05:02

I\'m new to Meteor and I\'m trying to understand how to serve static content - images, JS, etc.. I\'ve followed the docs by creating the correct folder structure (which it doesn

3条回答
  •  [愿得一人]
    2021-02-05 05:23

    The setup you have described sounds correct to me. Media in public/ are served like

    http://localhost:3000/myphoto.jpg
    

    The todos example serves images from the public directory. Just back out of whatever project you're in and run: meteor create --example todos then cd into todos/ and run meteor. Then open:

    http://localhost:3000/destroy.png 
    

    The image you will see lives in public/.

提交回复
热议问题