alfred 1.1.1 copy "alfred: ^1.1.1" to clipboard
alfred: ^1.1.1 copied to clipboard

A performant, expressjs like web server / rest api framework thats easy to use and has all the bits in one place.

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
150
points
1.84k
downloads

Publisher

unverified uploader

Weekly Downloads

A performant, expressjs like web server / rest api framework thats easy to use and has all the bits in one place.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause, MIT (license)

Dependencies

meta, mime, mime_type, path, queue

More

Packages that depend on alfred