Serve static content from a base URL in Dropwizard 0.7.1 -


It was easy Dropwhecker 0.6.2, but with a move of 0.7.x it has become much more difficult. I can get it to work, but in a way completely not suitable. I would like to look for my strong API to be available at my "/ api / *" point, and the static content available from the root URL "/".

The best I present In 0.7.1 "API / " is the service of API content, and there is static content of "/ API / asset / ". It is not terrible, but if I originally asked the target So, things will get very good from it. I have configured my AssetBundle () I have tried, I have tried, whatever has seen in the source, and tried to create my own dedicated static assets bundle class, everyone has no advantage.

I did the right thing Is now (which manages to manage my static content with "/ api / assets / *") as follows:

Public Zero Start (Bootstrap

.. and in my configuration file I have ...

Server: Type: Simple Connector: Type: Http port: 8458 applicationContextPath: / API .....

Does anyone give me a brief and full example of how my static content service is " / "Still retained to receive" / Api / * "On the service of my API? I have searched a long way and the signal, partial answer, the answers which are not to work in 0.7.1, and are ready to give me and serve my static content with a completely different server frequency (which is probably DW people think I should do anyway).

your application :

  @ override public zero start (bootstrap  bootstrap) {// static property source / main / resource / asset bootstrap.addBundle (new assets bundle (" / asset " , "/")); } @ Override Public Own Run (Example Configuration Configuration, Environmental Environment) Exception {environment.jersey ()) throws set URL ("/ API / *"); }  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -