emptygif
Lugha: Kiswahili

Lugha na framework zote

Dart Frog Dart

Kipande cha Dart kwa Dart Frog kinachojibu maombi ya /pixel.gif kwa empty GIF, ambayo husimbuliwa (decode) mara moja programu inapoanza.

Dart Frog Dart

Sakinisha
dart pub global activate dart_frog_cli
Faili
pixel.gif.dart
Endesha
dart_frog dev
// routes/pixel.gif.dart: the file name is the route.
import 'dart:convert';

import 'package:dart_frog/dart_frog.dart';

final _gif = base64Decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');

Response onRequest(RequestContext context) {
  return Response.bytes(
    body: _gif,
    headers: {'content-type': 'image/gif', 'cache-control': 'no-store'},
  );
}

Tuliendesha kipande hiki na kulinganisha baiti kilizorudisha.

Kagua

curl -sI http://localhost:8080/pixel.gif

Tovuti rasmi: Dart Frog

Zaidi katika Dart