sevr 1.0.1 copy "sevr: ^1.0.1" to clipboard
sevr: ^1.0.1 copied to clipboard

outdated

A library to easily create http servers with Dart and perform Http requests.

example/example.dart

import 'package:sevr/sevr.dart';

main() {
  var serv = Sevr();

  //so like express we can create controller,middleware classes etc and then put them in a list and then pass them into the router methods
  serv.get('/test', [
    (req, res) {
      return res.status(200).json({'status': 'ok'});
    }
  ]);

  serv.listen(3000, callback: () {
    print('Listening on ${3000}');
  });
}

//  controllerClassOne(req,res)async{
//   res.locals['response'] = req.body;
// }

// controllerReturn(req,res){
//   print('running the second function');
//   return res.status(200).json(res.locals['response']);
// }
16
likes
0
pub points
31%
popularity

Publisher

unverified uploader

A library to easily create http servers with Dart and perform Http requests.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

body_parser, http_parser

More

Packages that depend on sevr