zaptools_server 0.1.2 copy "zaptools_server: ^0.1.2" to clipboard
zaptools_server: ^0.1.2 copied to clipboard

A toolkit for Event-Driven websocket management.

example/zaptools_server_example.dart

import 'package:zaptools_server/zaptools_server.dart';

void main() async{
  
  final app = ZapServer();

  app.onConnected((contexts) {
    print('client connected');
  });

  app.onDisconnected((context) {
    print('client disconnected!');
  });

  app.onEvent('hello', (context) {
    context.connection.send('bye', 'see ya!');
   });

  final server = await app.start();
  print('listen on -> ${server.port}');
}
3
likes
0
pub points
3%
popularity

Publisher

unverified uploader

A toolkit for Event-Driven websocket management.

Repository (GitHub)
View/report issues

Topics

#server #websocket

License

unknown (license)

Dependencies

uuid, web_socket_channel

More

Packages that depend on zaptools_server