Closed devnix closed 5 years ago
PS: labelling as question
on the title because I am not able to assign labels.
Ok, seems like I fixed it with the --ipv4-only
param, but I'm just getting an ERR_EMPTY_RESPONSE
. If I stop the server I will get an expected ERR_CONNECTION_REFUSED
, so it seems to be working in some way...
No matter what I try I will not get any output, even with the examples given on this repo.
Have you tried to expose one example from your container?
The simplest HTTP app is in examples/vsgi/app.vala.
That example gives to me an ERR_SOCKET_NOT_CONNECTED
or an ERR_CONNECTION_RESET
randomly. Is it expecting a WSGI connection instead of an HTTP one?
Try to add --any
, otherwise it will listen only on the loopback.
I meant --address 0.0.0.0:62481
, I'm not sure if --any
works at all.
It's working! If I deliberatedly call a random path I get a "The request URI '/test' was not found." in the browser, but if I visit the /
route, instead of getting my Hello world!
text on the screen the browser generates me a file download with that content. I don't know if that's what I should expect of the current code inside my repo
That's definately what you should expect from your code. You have a single route defined on /
that output Hello world!
.
I'm trying to push a v0.3.16 release that works on the latest LTS image (Ubuntu Bionic). Stay tuned!
But a file download?
You have to add:
res.headers.set_content_type ("text/plain", null);
Otherwise, the browser will assume it is binary (i.e. application/octet-stream
).
The clean way of doing this is by adding content negotiation. If the browser does not accept this type of content, an error will be raised and basic
will handle it by producing the appropriate status code.
using Valum.ContentNegotiation;
app.use (accept ("text/plain"));
Stable docs are here by the way: https://valum-framework.readthedocs.io/en/stable/
Okay, now I'm working on a structure for my project. I think I can close the issue, thank you so much!
Hi! I'm taking the docs quickstart, but I'm stuck on one of the most basic steps.
When I build the app I only get this message (apart from tons of compilation warnings from Valum):
It doesn't make any difference if I change the port. I also tried to install and run Apache and it works perfectly, so I just don't get what I'm doing wrong!
I'm building and runnig the project in Docker. You can check it out here: https://github.com/devnix/valabb