Questions tagged [dart-shelf]

Shelf is a web server middleware for Dart. Shelf makes it easy to create and compose web servers and parts of web servers.

This tag is for questions about shelf and shelf extension packages.

Shelf makes it easy to create and compose web servers and parts of web servers. How?

50 questions
0
votes
1 answer

Separating a Cascade in Dart

I'm seeing some weird behavior in Dart. My goal is to only serve static assets if a build/web Dir exists. 1- The following works: Cascade cc; if(new Directory(buildPath).existsSync() ) { cc = new Cascade().add(apiHandler).add(fHandler); } else { …
Jack Murphy
  • 2,952
  • 1
  • 30
  • 49
0
votes
1 answer

Serving content dynamically using the directory parameter for GET requests - shelf package dart

The code snippets below come from a server serving a get request Server snippets 1) io.serve(handler, InternetAddress.LOOPBACK_IP_V4, 8080).then((server) { print('Listening on port 8080'); }).catchError((error) => print(error)); 2) Router…
Lukasz
  • 2,257
  • 3
  • 26
  • 44
-1
votes
1 answer

FormatException reading multipartFormData in Dart Shelf application

I have client and server application using Dart. Client sends song.m4a file to server. Server trying to read the file using shelf_multipart library. While reading file, server reports FormatException: Missing extension byte(at offset 44). Client…
Tusshu
  • 1,664
  • 3
  • 16
  • 32
-1
votes
1 answer

How to add CORS middleware in shelf with router?

I am new to server side programming with dart. I made a simple API server with a number of get routes. I am handling this as follow, Router router = Router(); router.get('/', checkSTATUS); router.get('/login//', (Request request,…
GunJack
  • 1,928
  • 2
  • 22
  • 35
-1
votes
1 answer

How to pass a logger to logRequests in dart shelf?

I'm trying to use the logRequests function from shelf. Function is as follows: Middleware logRequests( {void logger(String message, bool isError)?} ) And implementation is like: Middleware logRequests({void Function(String message, bool…
jRicardo
  • 804
  • 10
  • 20
1 2 3
4