Meteor public folder not working

后端 未结 3 1942
醉酒成梦
醉酒成梦 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:34

    Meteor public folder not working

    Use ./public directory for serving static assets.

    Given the following directory structure:

    - server
    - client
    - public
      - css
        - bootstrap.css
      - images
      - js
    

    You could serve the static assets by dropping 'public' from linked documents.

    More info here: Official Meteor Docs #FileStructure

    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.

提交回复
热议问题