storm 1.0.1+3 copy "storm: ^1.0.1+3" to clipboard
storm: ^1.0.1+3 copied to clipboard

A Dart package for developing modern web server

A Dart package for developing modern web server #

* This project is still under development. *

Installing

Storm Logo

Todo #

  • Route handling
  • Dynamic routes
  • Query parameters
  • Decode body (multipart/form-data, url-encoded )
  • Plugins

Example code #

import 'package:storm/storm.dart';

void main(List<String> arguments) {
  Storm app = Storm(port: 4040);

  app.plugin(new Cors());

  app.use(Route(
      path: '/',
      method: RequestMethod.ANY,
      handler: (Request request, Response response) {
        response.send(request.body);
      }));

  app.use(Route(
      path: '/about/:id/',
      method: RequestMethod.ANY,
      handler: (Request request, Response response) {
        response.sendHTML('<h1>${request.params?["id"]}</h1>');
      }));

  app.use(Route(
      path: '/posts/',
      method: RequestMethod.ANY,
      handler: (Request request, Response response) {
        print(request.params);
        print(request.queryParameters["hello"]);
        response.sendHTML(
            '<h1>About working ${request.queryParameters["hello"]}</h1>');
      }));

  app.start();
}

9
likes
90
pub points
0%
popularity

Publisher

verified publishershanbhag.dev

A Dart package for developing modern web server

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on storm