All Projects → deriegle → dart-express

deriegle / dart-express

Licence: BSD-2-Clause license
Express-like HTTP framework written in Dart

Programming Languages

dart
5743 projects
Mustache
554 projects

Projects that are alternatives of or similar to dart-express

Asher.Ai
Welcome to the API side of Asher, where all the language processing happens.
Stars: ✭ 20 (-41.18%)
Mutual labels:  api-server, api-rest
foxx-builder
ArangoDB Foxx Services in a super intuitive way
Stars: ✭ 22 (-35.29%)
Mutual labels:  api-server, api-rest
ExpressWebJs
ExpressWebJs is a Node FrameWork with expressive and organised syntax that runs on all major operating systems. It provides the starting point for creating your node project, allowing you to focus more on developing your amazing solution. It takes the pain out of development by easing common tasks (Environment Setup, Code Structure, Robust routi…
Stars: ✭ 58 (+70.59%)
Mutual labels:  api-server, api-rest
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (+432.35%)
Mutual labels:  api-server, api-rest
Spyne
A transport agnostic sync/async RPC library that focuses on exposing services with a well-defined API using popular protocols.
Stars: ✭ 992 (+2817.65%)
Mutual labels:  api-server, api-rest
FSharp.JsonApi
Use F# to create and consume flexible, strongly typed web APIs following the JSON:API specification
Stars: ✭ 20 (-41.18%)
Mutual labels:  api-server, api-rest
Webgo
A minimal framework to build web apps; with handler chaining, middleware support; and most of all standard library compliant HTTP handlers(i.e. http.HandlerFunc).
Stars: ✭ 165 (+385.29%)
Mutual labels:  api-server, api-rest
reedelk-runtime
Reedelk Runtime Platform Community Edition
Stars: ✭ 25 (-26.47%)
Mutual labels:  api-server, api-rest
Zato
ESB, SOA, REST, APIs and Cloud Integrations in Python
Stars: ✭ 889 (+2514.71%)
Mutual labels:  api-server, server-side
Json Server Heroku
Deploy json-server to Heroku & Azure 🆙 🆓
Stars: ✭ 310 (+811.76%)
Mutual labels:  api-server, api-rest
Magento-Extra-RESTful
Many more REST resources for Magento's API
Stars: ✭ 32 (-5.88%)
Mutual labels:  api-server, api-rest
Gemini
Model Driven REST framework to automatically generate CRUD APIs
Stars: ✭ 138 (+305.88%)
Mutual labels:  api-server, api-rest
elemental-lowcode
Elemental lowcode development platform.
Stars: ✭ 44 (+29.41%)
Mutual labels:  api-server, api-rest
Aceql Http
AceQL HTTP is a framework of REST like http APIs that allow to access to remote SQL databases over http from any device that supports http.
Stars: ✭ 68 (+100%)
Mutual labels:  api-server, api-rest
Appkernel
API development made easy: a smart Python 3 API framework
Stars: ✭ 152 (+347.06%)
Mutual labels:  api-server, api-rest
Quell
Quell is an easy-to-use, lightweight JavaScript library providing a client- and server-side caching solution for GraphQL. Use Quell to prevent redundant client-side API requests and to minimize costly server-side response latency.
Stars: ✭ 473 (+1291.18%)
Mutual labels:  server-side
Blog Service
blog service @nestjs
Stars: ✭ 188 (+452.94%)
Mutual labels:  api-server
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (+423.53%)
Mutual labels:  api-server
smockin
Dynamic API, S3 & Mail mocking for web, mobile & microservice development.
Stars: ✭ 74 (+117.65%)
Mutual labels:  api-rest
MyAPI
A template to create awesome APIs easily ⚡️
Stars: ✭ 117 (+244.12%)
Mutual labels:  api-server

Dart Express Dart CI

An express-like web server framework for Dart developers.

Usage

A simple usage example:

import 'package:dart_express/dart_express.dart';

main() {
  final app = express();

  app.get('/', (req, res) {
    res.json({
      'hello': 'world',
      'test': true,
    });
  });

  app.listen(3000, (port) => print('Listening on port $port');
}

Example with route parameters

import 'package:dart_express/dart_express.dart';

main() {
  final app = express();

  app.get('/users/:userId/posts/:postId', (req, res) {
    res.json({
      'userId': req.params['userId'],
      'postId': req.params['postId'],
    });
  });

  app.listen(3000, (port) => print('Listening on port $port');
}

With Body parsing Middleware:

import 'package:dart_express/dart_express.dart';

main() {
  final app = express();

  app.use(BodyParser.json());

  app.post('/post', (req, res) {
    print(req.body);

    res.send({
      'request_body': req.body,
    });
  });

  app.listen(3000, (port) => print('Listening on port $port');
}

Using the mustache templating engine

import 'package:dart_express/dart_express.dart';

main() {
  final app = express();

  app.use(BodyParser.json());
  app.engine(MustacheEngine.use());

  app.settings
    ..viewsPath = 'custom_views_path'
    ..viewEngine = 'mustache';

  app.get('/', (req, res) {
    res.render('index', {
      'app_name': 'My Test App',
    });
  });

  app.listen(3000, (port) => print('Listening on port $port');
}

Listening to Https requests

  //listen for http requests
  app.listen(port: 80, cb: (port) => print('listening for http on port $port'));

  //assign certificate
  var context = SecurityContext();
  final chain = Platform.script.resolve('certificates/chain.pem').toFilePath();
  final key = Platform.script.resolve('certificates/key.pem').toFilePath();

  context.useCertificateChain(chain);
  context.usePrivateKey(key);

  //listen for https requests
  app.listenHttps(
    context,
    port: 443,
    cb: (port) => print('Listening for https on port $port'),
  );

Currently supported View Engines

  • Basic HTML
  • Mustache
  • Markdown
  • Jael
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].