diff options
author | 2016-07-19 16:20:03 +0300 | |
---|---|---|
committer | 2016-07-19 16:20:03 +0300 | |
commit | 34d1411d80ce18807448e97ce21062122a9afaae (patch) | |
tree | e020bbf77e8baa001d976661fbea36de2556ba57 /juick-ws/src/main/java/com/juick/ws/StatusController.java | |
parent | 7f80c591731625c5c2c7219a267bda1630634d7c (diff) |
juick-ws: add status page
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/StatusController.java')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/StatusController.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/StatusController.java b/juick-ws/src/main/java/com/juick/ws/StatusController.java new file mode 100644 index 00000000..3f1de413 --- /dev/null +++ b/juick-ws/src/main/java/com/juick/ws/StatusController.java @@ -0,0 +1,23 @@ +package com.juick.ws; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.inject.Inject; + +/** + * Created by vitalyster on 19.07.2016. + */ +@Controller +@ResponseBody +public class StatusController { + @Inject + WebsocketComponent websocketComponent; + + @RequestMapping(method = RequestMethod.GET, headers = "Connection!=Upgrade", value = "/") + public String status() { + return String.format("Clients: %d", websocketComponent.clients.size()); + } +} |