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
7
votes
1 answer

Executing std.process synchronously from vibe.d sometimes silently hangs the server

I wrote a vibe.d web-UI for clang-format, when presented with this input while using LLVM style, the server hangs. The code for handling POST: void post(string style, string code) { import std.algorithm; import std.file; import…
krzaq
  • 16,240
  • 4
  • 46
  • 61
5
votes
5 answers

What are the options for REST frameworks in D?

I would like to use d to create a RESTful web application. What are the most actively maintained and contributed projects that are worth considering? A short comparison of these web frameworks with pluses and minuses will be nice. My search lead me…
Salil
  • 9,534
  • 9
  • 42
  • 56
4
votes
2 answers

How to insert Date to ArangoDB?

I can't understand what format use ArangoDB for date storage. Attempt to insert date in such format: {"name": "vasia", "date": date("2013-01-15")} std.json.JSONException@C:\vibe-d-0.7.24\source\vibe\data\json.d(1116): (1): Error: Expected valid…
Suliman
  • 1,469
  • 3
  • 13
  • 19
4
votes
2 answers

Can't connect to MySQL/MariaDB database from vibed app

All work fine if I use custom main ( void main() instead of shared static this() ). With default main I am getting "Access Violation" error. It's look like MySQL not allow connecting to it from localhost, but in my.ini I added string: bind-address =…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
4
votes
1 answer

Is there a way to generate interface from class in D using mixin or template?

I am using vibe.d to generate some REST interfaces from classes. However, vibe.d requires me to provide both interface and class implementing this interface. My application is small and contains only one implementation of this interface, and it is…
Korobochka
  • 137
  • 2
  • 5
3
votes
2 answers

How can I return JSON with HTTP code in Vibe.d?

I would like to return not only JSON, but also the HTTP response code. I registering REST interface through URLRouter: router.registerRestInterface(new ClientServerAPI); Example of my REST implementation: module…
ChronosX88
  • 53
  • 6
3
votes
1 answer

Set MIME type for fetched file

I have a static file server (made with vibe.d) serving a website that uses ES6 modules but with .mjs extension. My browser (Chromium on Arch Linux) is throwing an error when it fetches the module files server responded with a non-JavaScript MIME…
Lupus Ossorum
  • 450
  • 3
  • 16
3
votes
1 answer

How to load files to local file system with vibed?

I need to send data from web-browser to local FS. For sending data I am using Vue-JS component Inside Slot Text My server side based on…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
3
votes
1 answer

Unable to throw exceptions in the delegate called by listenTCP function

Binary file produced from the following code works perfectly on one computer (Windows 8 x64) and crashes on another (Windows Server 2012 R2 Standard x64): import std.stdio; import vibe.vibe; void new_request(TCPConnection conn) { …
FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
3
votes
1 answer

getting started with vibe.d

I'm trying to get vibe.d up and running through dub, as documented at http://vibed.org/docs#first-steps. Following that produced a dub.json like: { "name": "accounts", "description": "A simple vibe.d server application.", "copyright": "Copyright…
3
votes
1 answer

What are aliases in vibe.d's Diet templates?

I can see in Vibed's Diet source code, the void compileDietString(string diet_code, ALIASES...)(OutputStream stream__) function. I see it takes up to an infinite amount of aliases, as a template parameter. What are these aliases? I have trouble…
Jeroen
  • 15,257
  • 12
  • 59
  • 102
3
votes
2 answers

Use a variable with Vibe.d when rendering a template file with response.render

Currently I'm using Vibe.d to make a website, which has a Response class that's handed to every request. That looks something like this: import vibe.d; void index(HTTPServerRequest req, HTTPServerResponse res) { res.render!("index.dt",…
jaredonline
  • 2,912
  • 2
  • 17
  • 24
2
votes
1 answer

How to change event-loop lib in vibed?

I need to change event-loop in vibed. Docs says that "vibe.d has always used libevent under the hood by default" and "libasync is a cross-platform event loop library written completely in D". How I can change libevent to libasync? I found example of…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
2
votes
3 answers

What is the right way to access to instance of class methods outside scope?

I have got follow code: import std.stdio; import database; import router; import config; import vibe.d; void main() { Config config = new Config(); auto settings = new HTTPServerSettings; settings.port = 8081; …
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
2
votes
1 answer

vibe.d: Try to send a Message to a stopped Task

When sending a Message to a stopped vibe.d Task, the application gets an segmentation fault. I did not expect the message to be delivered, but to get notified about the failed sending attempt (or at least not to crash). The following example…
Skruppy
  • 63
  • 6
1
2 3 4 5