All Projects → carlosjs23 → evy

carlosjs23 / evy

Licence: MIT License
Dart 2 Web Framework, with an ExpressJS like API.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to evy

cryptoplease-dart
Dart and Flutter apps and libraries maintained by Espresso Cash (Formerly Crypto Please) team for Solana.
Stars: ✭ 188 (+840%)
Mutual labels:  dart2
Aqueduct-MongoDB
Building a Blog API with Aqueduct framework and MongoDB
Stars: ✭ 15 (-25%)
Mutual labels:  dart2
flutter survey app
Flutter Survey App concept
Stars: ✭ 43 (+115%)
Mutual labels:  dart2
json2dart-converter
Android Studio plugin for converting json to dart classes.
Stars: ✭ 35 (+75%)
Mutual labels:  dart2
swipedetector
A Flutter package to detect up, down, left, right swipes.
Stars: ✭ 34 (+70%)
Mutual labels:  dart2
Gumao-Flutter
Gumao: A Game Character Collector App built using Flutter
Stars: ✭ 35 (+75%)
Mutual labels:  dart2
flutter flip view
No description or website provided.
Stars: ✭ 56 (+180%)
Mutual labels:  dart2
fpfantasy
Fp fantasy in Dart 2
Stars: ✭ 21 (+5%)
Mutual labels:  dart2
Flutter-Example
Flutter练手项目,通过一些实例项目来学习、记录 Flutter 的知识点,zhihu、2048
Stars: ✭ 44 (+120%)
Mutual labels:  dart2
pubspec-version
A CLI tool to get/set/bump the `version` key in pubspec.yaml.
Stars: ✭ 25 (+25%)
Mutual labels:  dart2
FlutterMovieDetail
Simple Flutter Movie List & Detail Screen ui.
Stars: ✭ 40 (+100%)
Mutual labels:  dart2
liveshop
融合电商与直播的跨平台APP,主要采用了Flutter技术开发而成,目前开发中
Stars: ✭ 24 (+20%)
Mutual labels:  dart2
pub-scaff
scaff, scaffold generator for Dart and Flutter
Stars: ✭ 27 (+35%)
Mutual labels:  dart2
flutter google maps
A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.
Stars: ✭ 86 (+330%)
Mutual labels:  dart2
cross connectivity
A Flutter plugin for handling Connectivity and REAL Connection state in the mobile, web and desktop platforms. Supports iOS, Android, Web, Windows, Linux and macOS.
Stars: ✭ 27 (+35%)
Mutual labels:  dart2
cast
A flutter cast plugin
Stars: ✭ 23 (+15%)
Mutual labels:  dart2
hasFlutterPassedReactNativeYet
🎯 A Dart Web App to compare ↔️ GitHub stars of Flutter and React Native
Stars: ✭ 17 (-15%)
Mutual labels:  dart2
instagram private api
An Instagram-Client written in Dart
Stars: ✭ 39 (+95%)
Mutual labels:  dart2
flutter material color picker
Material color picker, you can customize colors. Selection in two step, first main color and after shades.
Stars: ✭ 68 (+240%)
Mutual labels:  dart2
crypton
A simple Dart library for asymmetric encryption and digital signatures
Stars: ✭ 25 (+25%)
Mutual labels:  dart2

Evy

Gitter chat

Evy is a Dart 2 Web Framework, with an ExpressJS like API.

Getting Started

For start using Evy in your project you need to clone this repo and add it to dependencies section in your pubspec.yaml file:

# pubspec.yaml
name: example_app
description: My app

dependencies:
 evy: 
    path: /path/to/evy

Prerequisites

Example code

import 'package:evy/evy.dart';

void main() {
  var app = Evy();

  /// This middleware will match all routes.
  app.use(handler: logRequest);

  /// This middleware will be called only for '/greet/:name' routes.
  app.use(path: '/greet/:name', handler: checkName);

  /// This middleware will be called only for '/greet/:name' routes.
  /// It will be executed after checkName middleware.
  app.use(path: '/greet/:name', handler: changeName);

  /// Or just pass the middleware callbacks as a list.
  ///  app.use(path: '/greet/:name', callback: [checkName, changeName]);

  ///Routes can have a callback for process the request.
  app.get(path: '/greet/:name', handler: sayHello);

  ///Path can be a RegExp, this route will match /evy, /evyhi, /whateverevy... .
  app.get(path: RegExp('/.*evy'), handler: sayHello);

  ///Path can be a List of Strings, this will match /users, /user and /client.
  app.get(path: ['/users', '/user', '/client'], handler: sayHello);

  app.listen(
      port: 3000,
      callback: (error) {
        if (error != null) {
          print(error);
        } else {
          print('Server listening on port 3000');
        }
      });
}

void changeName(Request req, Response res, next) {
  if (req.params['name'] == 'Alberto') {
    req.params['name'] = 'Carlos';
  }
  next();
}

void checkName(Request req, Response res, next) {
  if (req.params['name'] != 'Alberto') {
    res.send('Only Alberto is allowed to use this action');
  } else {
    next();
  }
}

void logRequest(Request req, Response res, next) {
  /// Do your logging stuff and then call next()
  print('${req.ip} - - [${DateTime.now()}] "${req.method} ${req.originalUrl}"');
  next();
}

void sayHello(Request req, Response res, next) {
  if (req.params['name'] != null) {
    res.send('Hello ${req.params['name']}');
  } else {
    res.send('Hello');
  }
}

Todo

  • Implement basic HTTP methods (POST, PUT, etc).
  • Create Request and Response wrappers.
  • Per Route Middlewares.
  • Global Middlewares.
  • Sub-apps app.use(path: '/billing', app: billingApp).
  • Serve static files (Use a package instead).
  • Content body parsing (Use a package instead).
  • Routes group.
  • Publish package to Dart Packages.
  • Testing.
  • Logo design.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].