Advertisement
Guest User

Untitled

a guest
Aug 20th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public static function create(Request $req, Response $resp, array $args)
  2. {
  3. $router = (new Router())
  4. ->route("GET", "ws", websocket(new Chat($args['id'])));
  5.  
  6. (new Host)
  7. ->name("chat.dev/room/" . $args['id'])
  8. ->expose("*", 1337)
  9. ->use($router)
  10. ;
  11.  
  12. return $resp->end('success');
  13. }
  14.  
  15. public static function load(Request $req, Response $resp, array $args)
  16. {
  17. $root = root(__DIR__ . "/../public");
  18.  
  19. (new Host)
  20. ->name("chat.dev/room/" . $args['id'])
  21. ->use($root)
  22. ;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement