Can DropWizard serve assets from outside the jar file?

后端 未结 6 599
猫巷女王i
猫巷女王i 2020-12-31 05:52

In looking at the documentation, it appears that DropWizard is only able to serve static content living in src/main/resources. I\'d like to keep my static files in a separat

6条回答
  •  旧巷少年郎
    2020-12-31 06:53

    The vast majority of websites that serve static content do so through a dedicated webserver, or, at larger scale, a CDN.

    Occasionally, you might want to deploy an application as a self-contained unit complete with all assets which is where Dropwizard comes in.

    It is possible to get Dropwizard to serve up assets from outside the classpath, but the easiest way to do this is to write your own asset endpoint that reads from an externally configured file path.

提交回复
热议问题