On 8/05/2015 10:17 p.m., Chris wrote:
On Thursday, 7 May 2015 at 19:51:20 UTC, yawniek wrote:
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
1. Do I need write ./public/ ? In examples often simply public/
will work too. even public
it goes trough Path struct, see:
On Friday, 8 May 2015 at 10:20:35 UTC, Rikki Cattermole wrote:
On 8/05/2015 10:17 p.m., Chris wrote:
On Thursday, 7 May 2015 at 19:51:20 UTC, yawniek wrote:
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
1. Do I need write ./public/ ? In examples often simply
public/
will work too.
On Thursday, 7 May 2015 at 19:51:20 UTC, yawniek wrote:
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
1. Do I need write ./public/ ? In examples often simply
public/
will work too. even public
it goes trough Path struct, see:
On 8/05/2015 10:49 p.m., Chris wrote:
On Friday, 8 May 2015 at 10:20:35 UTC, Rikki Cattermole wrote:
On 8/05/2015 10:17 p.m., Chris wrote:
On Thursday, 7 May 2015 at 19:51:20 UTC, yawniek wrote:
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
1. Do I need write ./public/ ? In
On Thursday, 7 May 2015 at 09:27:39 UTC, Chris wrote:
On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote:
You're not setting a port.
add:
settings.port = 8080;
before listenHTTP();
then it'll work.
It's do not help :(
This should work, put it in your `app.d` file:
import vibe.d;
Is next example is enough to serv simple index.html page?
void setupServer()
{
auto router = new URLRouter;
// add other routes here
router.get(*, serveStaticFiles(public/));
auto settings = new HTTPServerSettings;
listenHTTP(settings, router);
}
After
You're not setting a port.
add:
settings.port = 8080;
before listenHTTP();
then it'll work.
It's do not help :(
On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote:
You're not setting a port.
add:
settings.port = 8080;
before listenHTTP();
then it'll work.
It's do not help :(
You're sure?
My app.d is:
import std.stdio;
import vibe.d;
shared static this(){
auto router = new URLRouter;
On Thursday, 7 May 2015 at 09:08:53 UTC, wobbles wrote:
On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote:
You're not setting a port.
add:
settings.port = 8080;
before listenHTTP();
then it'll work.
It's do not help :(
You're sure?
My app.d is:
import std.stdio;
import vibe.d;
On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote:
You're not setting a port.
add:
settings.port = 8080;
before listenHTTP();
then it'll work.
It's do not help :(
This should work, put it in your `app.d` file:
import vibe.d;
shared static this()
{
auto settings = new
On Thursday, 7 May 2015 at 08:09:50 UTC, Suliman wrote:
Is next example is enough to serv simple index.html page?
void setupServer()
{
auto router = new URLRouter;
// add other routes here
router.get(*, serveStaticFiles(public/));
auto settings = new
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
1. Do I need write ./public/ ? In examples often simply
public/
will work too. even public
it goes trough Path struct, see:
https://github.com/rejectedsoftware/vibe.d/blob/11578aa956a9b3b0e305d655f9668a867fdd89bd/source/vibe/inet/path.d
shared static this()
{
auto router = new URLRouter;
router.get(/, root);
auto settings = new HTTPServerSettings;
settings.port = 8080;
listenHTTP(settings, router);
}
void root(HTTPServerRequest req, HTTPServerResponse res)
{
serveStaticFiles(public/);
}
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
shared static this()
{
auto router = new URLRouter;
router.get(/, root);
auto settings = new HTTPServerSettings;
settings.port = 8080;
listenHTTP(settings, router);
}
void root(HTTPServerRequest req,
Later you can have more sophisticated methods, e.g. if you want
to handle query strings you could do something like this:
import vibe.d;
shared static this()
{
auto settings = new HTTPServerSettings;
settings.port = 8080;
settings.bindAddresses = [::1, 127.0.0.1];
auto router = new
On Wednesday, 6 May 2015 at 13:32:48 UTC, Suliman wrote:
By default vibed use Diet. Maybe it's cool, but for me it's
easier to write in pure HTML. What is the best way to do it?
You want to serve html files instead of templates, right? It
should be something like
router.get(*,
On Wednesday, 6 May 2015 at 13:50:04 UTC, Chris wrote:
On Wednesday, 6 May 2015 at 13:32:48 UTC, Suliman wrote:
By default vibed use Diet. Maybe it's cool, but for me it's
easier to write in pure HTML. What is the best way to do it?
You want to serve html files instead of templates, right? It
I mean that I know that template can be changes dynamically, but
I thought that 99% of dynamic is javascript code...
By default vibed use Diet. Maybe it's cool, but for me it's
easier to write in pure HTML. What is the best way to do it?
You want to serve html files instead of templates, right? It
should be something like
Yeah, I do not see any profits with using templates right now.
Explain me if I am wrong.
On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote:
I mean that I know that template can be changes dynamically,
but I thought that 99% of dynamic is javascript code...
What if the user has Javascript disabled, or is using some client
that doesn't execute Javascript (spiders and
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote:
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
Especially this: http://vibed.org/templates/diet#embedded-code
I think that's a misfeature... if I used vibe.d, I'd want to
avoid the diet too.
I agree
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote:
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
Especially this: http://vibed.org/templates/diet#embedded-code
I think that's a misfeature... if I used vibe.d, I'd want to
avoid the diet too.
I have never used the
On Wednesday, 6 May 2015 at 14:21:24 UTC, Chris wrote:
On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote:
I mean that I know that template can be changes dynamically,
but I thought that 99% of dynamic is javascript code...
Templates are like PHP, JSP, LSP etc. They can do stuff on the
On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote:
I mean that I know that template can be changes dynamically,
but I thought that 99% of dynamic is javascript code...
Templates are like PHP, JSP, LSP etc. They can do stuff on the
server side via embedded D code, load files for example.
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
Especially this: http://vibed.org/templates/diet#embedded-code
I think that's a misfeature... if I used vibe.d, I'd want to
avoid the diet too.
You can put that dynamic data in regular HTML too as long as you
generate it on the server.
I imagine vibe.d must support some kind of raw output write
function, if you find that, you can make your html then just
write it out as a string.
On Wednesday, 6 May 2015 at 20:45:10 UTC, John Colvin wrote:
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote:
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
Especially this: http://vibed.org/templates/diet#embedded-code
I think that's a misfeature... if I used vibe.d,
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote:
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
Especially this: http://vibed.org/templates/diet#embedded-code
I think that's a misfeature... if I used vibe.d, I'd want to
avoid the diet too.
I quite like them. Obviously
auto html = someStringActions();
res.writeBody(cast(ubyte[])html);
Thanks, but how to attach to html css file? Now page is loading,
but do not handle css that also placed in this folder.
And how people write in jade if it's impossible to preview page
without compiling it's to HTML?
On Wednesday, 6 May 2015 at 18:52:41 UTC, Suliman wrote:
auto html = someStringActions();
res.writeBody(cast(ubyte[])html);
Thanks, but how to attach to html css file? Now page is
loading, but do not handle css that also placed in this folder.
CSS should be exported automatically when you
32 matches
Mail list logo