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
0 answers

dart shelf: Strange requests to my server: handlerPath "/" and url "43" must combine to equal requestedUri path "443"

I deployed dart shelf_router server to use as a service for my app. Everything works fine in terms of service and code. However, I see occasional (couple times per hour) strange request errors in journalctl logs, that I didn't make. Why do these…
Konstantin Kozirev
  • 944
  • 1
  • 10
  • 23
0
votes
1 answer

A directory corresponding to fileSystemPath "assets" could not be found

I attemplted to start a local webserver on Android using Flutter app. I'm using shelf & shelf_static. I've put index.html file in the assets folder of the root project folder. Then, I referenced it in the pubspec.yaml file. assets: -…
iqfareez
  • 555
  • 7
  • 21
0
votes
1 answer

Dart Server: The terminal always return Killed after using dart run

This dart server project work successfully when running on my PC. But when I ran it on the server, I got this. My server is Ubuntu 20.04 (LTS) x64. I tried it with this code: import 'dart:io'; import 'package:shelf/shelf.dart'; import…
0
votes
1 answer

Flutter Webview on Android with NetworkInfo shows ERR_CONNECTION_REFUSED

I have a flutter app starting a webserver (shelf) on localhost which serves a website and displays the website over webview in the app. So far it works to display the website over http://localhost:8080/ in webview on Android. But when I try to get…
0
votes
0 answers

Dart shelf server returns 503 when testing

I'm trying to write tests for my shelf server. And it returns 503 when I make a request in my unit tests, even though the server is started in my test setup. I also tested the route I make a call to in my unit test, in my browser, in the duration…
alireza easazade
  • 3,324
  • 4
  • 27
  • 35
0
votes
0 answers

The dart server was terminated when the server is trying to upload files (images) on production host

I am using Ubuntu 20.04 (LTS) x64, NGINX, memory 1 GB, Dart SDK version: 2.19.4 (stable) , and Dart server. I run this dart server in the console with: pm2 start dart --name dart_server -- run dart_server/bin/dart_server.dart pm2 logs The issue…
0
votes
0 answers

How to combine Cascades with Pipelines

My backend API has public and authenticated methods. I'm trying to encapsulate everything using Cascade and Pipelines, but the cascade seems to quit immediately after the first pipeline if the route isn't found. In short, I want all requests to be…
Cachapa
  • 1,761
  • 1
  • 15
  • 16
0
votes
1 answer

dart, shelf_route: What is route name in the `GET` method that work with the request that using multi parameter?

My flutter app sends the request to this API with the GET method and uses the queryParameters like this: Map parameters = {'id': null}; parameters.updateAll((key, value) => Uri.encodeComponent(jsonEncode(value))); String url=…
0
votes
0 answers

How to respond 'Expect: 100-continue' header in shelf [server]

I am using curl cli to upload a file to my shelf server, request contains header Expect: 100-continue, now curl abort by curl: (52) Empty reply from server, the correct responding seems server should 2 status codes(100 and 200): > POST /upload…
Wesley Chang
  • 1,433
  • 2
  • 9
  • 10
0
votes
2 answers

FileSystemException when runnning a Dart Shelf Docker Container

I generated a dart project with dart create -t server-shelf . --force. On the top folder I created a json file (my_data.json) with some mock data. In my code I am using the data from the json file like: final _data =…
R2T8
  • 2,122
  • 2
  • 14
  • 17
0
votes
1 answer

Print keys were values is null in map Employee in dart

This is the code json code from which I want to get all the keys were value is null { "service": "register", "employee": { "employeeId": "bcvfevse", "officeId": null, "email": null, "name" : "Chetan Patil", …
0
votes
1 answer

How to deploy Dart server to IIS

I want to deploy a basic dart server that uses shelf to an IIS server. I ran the command dart compile exe and tried to place the executable along with the web.config file in a file system. I set up the workpool with the settings I need. I have a DNS…
0
votes
0 answers

Why can't my dart shelf webservice be bound to 0.0.0.0?

I've been trying to change the hostname of this HTTPServer in order to access it from any machine on the network, however the site is still only accessible through localhost. I have tried parsing the "0.0.0.0" hostname string into an InternetAddress…
0
votes
1 answer

Why json parsing fails when read from a request but not from a direct String

I am trying out some code using the shelf package and json_serializable for handling JSON. I have 2 classes and a handler method all shown below (error handling omitted). @freezed abstract class User with _$User { …
Gary Becks
  • 11
  • 2
0
votes
1 answer

Server response with output from Future Object

i created a async/await function in another file thus its handler is returning a Future Object. Now i can't understand how to give response to client with content of that Future Object in Dart. I am using basic dart server with shelf package.Below…