Questions tagged [vibed]

vibe.d is an async i/o and web programming framework for D.

vibe.d is an async i/o and web programming framework for D. http://vibed.org/

70 questions
2
votes
1 answer

Minimal VPS configuration for vibed?

What is minimal configuration of VPS for Vibed? It's look like that vibed's memory print is very small. But building of it can take much more RAM. So what is minimum?
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
2
votes
1 answer

How to POST single object with vibe.d REST client generator

I trying to send post with some object using vibe.d rest client generator with such code: class App { string id; string cmd; } interface IntREST { @path("/apps") @method(HTTPMethod.POST) App postApp(App app); } and vibe.d…
zunkree
  • 21
  • 3
2
votes
1 answer

Logout from site cause error: 400 - Bad Request

I am using vibed.org framework. When I am processing logout function, I am getting strange error. Here is my App.d code: void main() { auto router = new URLRouter; router.any("/checkAuthorization", &checkAuthorization); …
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
2
votes
1 answer

When should I use logInfo and when writeln?

Vibed have logInfo class. In case when I need to write to console information about connection status what's better to use writeln or logInfo?
Suliman
  • 1,469
  • 3
  • 13
  • 19
2
votes
2 answers

Simple select from MongoDB with vibed

I am learning how to use MongoDB from vibed. I wrote simple app, that as I am thinking should do find operation. But when I run it I am getting error: Querying uninitialized MongoCollection.. What I am doing wrong? import vibe.core.log; import…
Suliman
  • 1,469
  • 3
  • 13
  • 19
2
votes
0 answers

vibe.d application code porting trouble

Abstract Vibe.d has undergone a lot of breaking changes. The same applied to the compiler. I'm trying to get running a piece of code written back in 2012 with an earlier release of the dmd compiler and vibe. My porting effort is in vain and I am…
menjaraz
  • 7,551
  • 4
  • 41
  • 81
2
votes
2 answers

How to Iterate through a JSON Array in Vibe.D?

What's the correct way, using the Vibe.D library, to iterate through a Json array? I have tried this, but it gives me compile errors: foreach(string index, Json value; configuration["array1"]) {} This is the error: Error: opApply() function for…
Jeroen
  • 15,257
  • 12
  • 59
  • 102
2
votes
1 answer

How to stop a Vibe.D application?

Does Vibe.D have a build-in terminate function, for when the library is run through a static initializer? I want to terminate the application when vibe.d throws an exception when for example opening a file. I have a server listening using the…
Jeroen
  • 15,257
  • 12
  • 59
  • 102
2
votes
1 answer

Is it possible to store current session information globally in vibe.d? (dlang)

The example from the site: import vibe.d; void login(HTTPServerRequest req, HTTPServerResponse res) { enforceHTTP("username" in req.form && "password" in req.form, HTTPStatus.badRequest, "Missing username/password field."); //…
carboncomputed
  • 1,630
  • 3
  • 20
  • 42
1
vote
0 answers

Sorting Json struct from vibe.d

I faced a problem with wrong sorting JSON keys. I use mongo db and I need to send a creating user form command. vibe-d JSON: Json a2 = Json([ "createUser": Json(req.form["user"]), "pwd":…
Wusiki Jeronii
  • 159
  • 1
  • 8
1
vote
2 answers

Iterate JSON during compile-time, in Dlang

I want to iterate over the JSON using CTFE. I have tried both std.json and vibe.data.json, but there is no luck. I am not sure what I am missing. import std.stdio; import std.json; import std.array; import vibe.data.json; void main() { enum…
1
vote
0 answers

Vibe.d HTTPRequest with proxy

I'm trying to use proxies for http requests with the vibe.d library like this: HTTPClientSettings settings = new HTTPClientSettings; settings.proxyURL = URL.parse("http://gb.smartproxy.com:30000"); auto response = requestHTTP("https://dlang.org",…
1
vote
1 answer

Vibe.d rest interface router wrong path matching

I'm using vibe.d for my rest API. I have two methods: addUser and getUser. I used @path("/api/v3/users/"), so now the URL should look like this: http://127.0.0.1:8080/api/v3/users/user. The POST method works fine with this URL, but I can't get the…
user9519356
1
vote
1 answer

Vibe.d - Can not generate JS script for rest api

I'm trying to generate JS for my simple REST API like eg described here: doc. My example code: import vibe.d; import wbapi; import std.array : appender; import vibe.core.file; void main() { // generate JS for access auto test =…
user3069488
  • 75
  • 1
  • 6
1
vote
1 answer

Error: template instance error instantiating

I am trying to display error message if req was too short. Here is code: import std.stdio; import vibe.d; Database mydatabase; void main() { // ... router.get("*", &myStuff); // all other request listenHTTP(settings, router); …
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145