This tag is for questions related server side development in the Dart programming language and its related server frameworks.
Questions tagged [dart-server]
32 questions
5
votes
2 answers
How to properly create a secure web server with Dart?
This a typical code provided by Dart for a server using Shelf package :
import 'dart:io';
import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart';
import 'package:shelf_router/shelf_router.dart';
// Configure routes.
final _router…

Ουιλιαμ Αρκευα
- 5,561
- 7
- 35
- 61
3
votes
3 answers
Why JIT & AOT has same performance when using Dart in server app?
In flutter application there is a lot of difference between JIT and AOT compilation when running the app, but in server application there is a small difference and sometimes AOT mode is slower than JIT. why this happen? is that means dart for server…

Rebe
- 127
- 2
- 8
3
votes
1 answer
What kind of errors are returned by HttpServer stream in Dart
I'm going through the Dart server documentation. I see I can await for an HttpRequest like this:
import 'dart:io';
Future main() async {
var server = await HttpServer.bind(
InternetAddress.loopbackIPv4,
4040,
);
print('Listening on…

Suragch
- 484,302
- 314
- 1,365
- 1,393
3
votes
1 answer
How to logout (ie, revoke, delete, or invalidate the tokens) for a user on an Aqueduct server?
I know how to implement a route to register a user and also how to trade user credentials in for an access token. These are both covered in the official tutorial.
How do you invalidate the access token (and refresh token) for a registered user.…

Suragch
- 484,302
- 314
- 1,365
- 1,393
2
votes
3 answers
dart server: retrieve data from Request
I was trying to create a simple dart server, glad it's working, but...
Future _echoHandler(Request request) async{
final message = await request.readAsString();
print(message);
return Response.ok('$message\n');
}
this is…

Shanu
- 311
- 2
- 16
2
votes
1 answer
How to get a refresh token from an Aqueduct server
The Aqueduct docs say that the server should return a refresh token. It should look like this:
{
"access_token" : "Abca09zzzza2o2kelmzlli3ijlka",
"token_type" : "bearer",
"refresh_token" : "lkmLIAmooa898nm20jannnnnxaww",
"expire_in" :…

Suragch
- 484,302
- 314
- 1,365
- 1,393
1
vote
1 answer
How to get the IP address of the user with shelf in dart server side?
In general, I can get the IP address of the request sender by:
import 'dart:io';
Future main() async {
final server = await HttpServer.bind(InternetAddress.anyIPv4, 8080);
print('Server listening on ${server.address}');
await for (var…

Sittiphan Sittisak
- 486
- 4
- 15
1
vote
1 answer
Can not convert the data that contains Int64 type to json
I am using mongo_dart.
Some field contains the Int64 type.
I tried to convert the Map type that receive from MongoDB to the JSON by using the jsonEncode function but I got this error:
Converting object to an encodable object failed:…

Sittiphan Sittisak
- 486
- 4
- 15
1
vote
1 answer
Can I use `objectId()` from `mongo_dart` to create a unique string?
I am finding a solution to create a unique string to create a file name. I realized that the ObjectId() has an id.$oid that is a unique string. But I am not sure. Is it work success full with this?
example code:
List…

Sittiphan Sittisak
- 486
- 4
- 15
1
vote
0 answers
Server not terminated when the program is stopped
I made a simple server app with Dart that receives and returns messages. It works great except when I stop the program the server keeps running in the background and I have to go to the cmd to kill the task before running the program again.
Why does…

Lodea
- 119
- 12
1
vote
1 answer
How to get query params in a server request in flutter?
In order to authenticate with Imgur on a mobile app, I decided to spawn an http server on port 8585 in order to complete the oauth flow. The request is read and a response is written, but I cannot access the queryparameters from the url.
I already…

MGassend
- 83
- 2
- 9
0
votes
1 answer
How to add font to the pubspec.yml for the dart server
I am using pdf package to generate a pdf file.
I want my custom font for the pdf file.
But I don't know how to add a font in the pubspec.yaml for the Dart project. This pubspec.yaml of the dart project doesn't have flutter:.

Sittiphan Sittisak
- 486
- 4
- 15
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…

Sittiphan Sittisak
- 486
- 4
- 15
0
votes
0 answers
Generate APIDocuments easily from Prisma Client in Conduit Dart Server
I've built dart-server using conduit frameworks and prisma package.
I'd like to generate api specifications using conduit document command.
The api endpoints are using lots of prisma schemas and need to extends Serializable for api specification.
Do…

William Harris
- 36
- 8
0
votes
0 answers
How and where best to deploy Dart language serverless functions
I'm building a Flutter app, and the project will at some stage require some serverless functions.
Are there ways to deploy DART language based serverless functions? I'm trying to avoid replicating business logic and data models in another language…

user2868835
- 1,250
- 3
- 19
- 33