mirror of
https://github.com/corda/corda.git
synced 2025-04-18 08:10:47 +00:00
Static endpoint
This commit is contained in:
parent
ea9d33d3e2
commit
d41ae4528e
@ -110,4 +110,23 @@ class InterestRateSwapAPI(val services: ServiceHub) {
|
||||
services.invokeProtocolAsync<Boolean>(ExitServerProtocol.Broadcast::class.java, 83).get()
|
||||
return Response.ok().build()
|
||||
}
|
||||
|
||||
@GET
|
||||
//@Path("{ref: .*(.html|.css|.js|.png|.jpg|.gif)}")
|
||||
@Path("web")
|
||||
@Produces(MediaType.TEXT_HTML)
|
||||
fun serveWeb() : Response {
|
||||
try
|
||||
{
|
||||
val resourcePath = "/web/index.html"
|
||||
val resource = javaClass.getResourceAsStream(resourcePath)
|
||||
println(resource);
|
||||
return Response.ok(resource, MediaType.TEXT_HTML_TYPE).build()
|
||||
}
|
||||
catch(ex: Exception)
|
||||
{
|
||||
return Response.status(Response.Status.NOT_FOUND).build()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user