pro 0.0.1 copy "pro: ^0.0.1" to clipboard
pro: ^0.0.1 copied to clipboard

outdated

A starting point for Dart Process Api package, for Using commondline app to Easyly access start stop restart commands, see demo or examples.

A RestFul Api library for Dart developers.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

restful api for small things...

your app.dart file example:


import 'package:restful/pro.dart';

//Change routes and actions

/// import apis
import 'api/SystemApi.dart';
import 'api/UserApi.dart';


dynamic routerMap(HttpRequest request) {
  var action = request.uri.pathSegments.isNotEmpty ? request.uri.pathSegments.first : 'none';
  switch (action) {
    case 'user':
      return UserApi();
    case 'system':
      return SystemApi();
  }
  throw Exception('not defined Api.${action} !?@!@#@# ');
}

void main(List<String> arguments) async {

  /// actions start stop restart available
  var pro = App.pro(arguments);
  if (!await pro.needRun()) return;

  App.init();
  await Api.start(routerMap, port: 4040);
}

Usage #


$ dart lib/app.dart start

$ dart lib/app.dart stop

$ dart lib/app.dart restart

$ dart lib/app.dart status

....

1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A starting point for Dart Process Api package, for Using commondline app to Easyly access start stop restart commands, see demo or examples.

Homepage

License

unknown (LICENSE)

Dependencies

alm, process_run

More

Packages that depend on pro