I want my server to serve static html files from /. In addition, css and js files must be sent with, /cssrespectively /js. All json data must be available in /api.
However, I get 404 for http://localhost:8080/or any other way.
I use the following parameter in the configuration file:
server:
type: simple
rootPath: /api/*
The application.initialize method looks like this:
@Override
public void initialize(io.dropwizard.setup.Bootstrap<MyConfiguration> bootstrap) {
bootstrap.addBundle(new AssetsBundle("/assets/css", "/css", null, "css"));
bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
bootstrap.addBundle(new AssetsBundle("/assets/pages", "/", "index.html", "html"));
}
source
share