This tutorial demonstrates servicing static content (files) with WoOF.
To have static files served by WoOF, create a PUBLIC folder on the class path. Any files within this directory will be served as static files by WoOF.
As anything on the class path /PUBLIC/** is served as static files, this gives a lot of flexibility in making the static files of the single page application available:
The following shows obtaining the index.html static file:
@RegisterExtension public MockWoofServerExtension server = new MockWoofServerExtension(); @Test public void indexPage() throws Exception { MockHttpResponse response = this.server.send(MockHttpServer.mockRequest("/")); response.assertResponse(200, "<html><body>Hello World</body></html>"); }
The next tutorial covers logging.