Routing static assets - Skullabs/kikaha GitHub Wiki
Serving a public resource in Kikaha is the same as serving any other HTTP request. Well, almost the same: it is easier! Basically, it mirrors the URI location sent as request to the web asset folder (usually configured as webapp
).
By default, routing static assets is disabled once Kikaha's design is focused on micro-services APIs. To enable you can set the server.static.enable
property to true
on your configuration file.
server:
static:
enabled: true
The kikaha-maven-plugin
is responsible for configure your web project, even if you just created an empty project. On projects created through the command line tool, and project that inherits the default kikaha-project, is possible to change the web folder by changing the property config.dir.web
on your pom.xml
file.
<properties>
<config.dir.web>my/new/webapp/folder</config.dir.web>
</properties>
If you manually created (or want to manually create) a maven project, you should configure the kikaha-maven-plugin
to point to the correct web folder.
<plugin>
<groupId>io.skullabs.kikaha</groupId>
<version>${KIKAHA-VERSION-HERE}</version>
<artifactId>kikaha-maven-plugin</artifactId>
<configuration>
<webresourcesPath>path/to/new/location</webresourcesPath>
</configuration>
</plugin>