I am trying to implement a basic server which serves both websockets and http requests.
Code is this;
import 'package:shelf_router/shelf_router.dart';
import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as io;
import…
I have a dart web service application written with Shelf and Rpc apis.
I need to check the client Ip inside my api methods, but I cannot figure how.
The context method does not contain the HttpRequest .contentInfo property.
More, also the shelf…
I've created a function that converts a model into JSON using mirror.
Map convertObjectToJson(Object obj);
dynamic convertJsonToObject(Map json, Type type);
I wish to use it so that my models/view-models are converted back and forth between…
Using shelf_auth I can extract current user information from request this way:
getAuthenticatedContext(request)
.map((ac) => ac.principal.name)
.getOrElse(() => 'guest')
but, obviously, I need a request for that to work :)
On the other hand,…
I am building a client/server app in Dart using Angular for the front-end and Shelf on the backend. When I do a pub build it generates the javascript for the Dart files as expected but is does not replace the dart references in my HTML files. So in…
Context
I am trying to create a Dart server with the library shelf.
I want it a bit scalable in order to get to production when my project will be ready.
And to facilitate the production release, I decided to use Docker in order to deploy it…
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…
I need to make a request to my firebase rtdb from my shelf server hosted on 127.0.0.1, I have the url and the db secrets. But whenever i try to make a get request to the db url using the http package, i get a 401 error.
My code:
import…
I have an http web server that I'm trying to detect long-running requests and abort them. The following code successfully returns to the client upon timeout, but the async zone still continues to run to completion. How can I actually kill the…
I would like to create a proxy server for my angular-dart applications that redirects me to index.html whenever I refresh the browser and the route is different from root. For example, if the url is: http://localhost:8080/users and I hit refresh…
I'm trying to run Angular2 alpha 35
I have a server setup with a static shelf server. It works fine for publishing to heroku after pub build.
When i use pub serve to test locally, i don't seem to have control over routing, and i need more granular…
incompatibility when running dart rpc and shelf (with shelf_rpc)
related to headers which are lists (and not Strings).
It seems that there is an incompatibility when running dart rpc and shelf (with shelf_rpc)
related to headers which are lists…
There seems to be an incompatibility between the shelf and rpc packages.
In rpc [0.4.1] config/api.dart: The handleHttpOptionsRequest expects the
'access-control-request-method' header to be a List:
Future…
I'm trying to serve a polymer application using a shelf static server. I create next structure:
polymerapp
- pubspec.yml
- bin
- server.dart
- web
- index.html
- lib
- main_app.dart
…
I've been trying to write a simple server that accepts username/password credentials, validates them, then creates a JWT token for the client that they then use to gain access to certain routes. I am able to do everything up to the point of…