alfred 0.1.0-alpha.5 copy "alfred: ^0.1.0-alpha.5" to clipboard
alfred: ^0.1.0-alpha.5 copied to clipboard

outdated

A performant, expressjs like server framework with a few bonuses that make life even easier.

example/example.dart

import 'dart:io';

import 'package:alfred/alfred.dart';

void main() async {
  final app = Alfred();

  app.get('/text', (req, res) => 'Text response');

  app.get('/json', (req, res) => {'json_response': true});

  app.get('/jsonExpressStyle', (req, res) {
    res.json({'type': 'traditional_json_response'});
  });

  app.get('/file', (req, res) => File('test/files/image.jpg'));

  app.get('/html', (req, res) {
    res.headers.contentType = ContentType.html;
    return '<html><body><h1>Test HTML</h1></body></html>';
  });

  await app.listen(6565); //Listening on port 6565
}
358
likes
0
pub points
89%
popularity

Publisher

unverified uploader

A performant, expressjs like server framework with a few bonuses that make life even easier.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

enum_to_string, http_server, mime_type, pedantic, queue, uuid

More

Packages that depend on alfred