mintyfresh / vibrant.d

A light framework on top of vibe.d
MIT License
11 stars 0 forks source link

Few questions #1

Closed bubnenkoff closed 9 years ago

bubnenkoff commented 9 years ago

Hello, could you add in readme comparison of classical vibed routing with Vibrant routing system?

Also I have got question:

shared static this()
{
    with(Vibrant)
    {
        Get("/hello", (req, res) => "Hello user!");

Analog of:

shared static this()
{
    Vibrant.Get("/hello", (req, res) => "Hello user!");
mintyfresh commented 9 years ago

Aye, I'll add a comparison in the README. One was originally present, but I removed it because it was fairly long on vibe.d's side of things.

Also, yes. Those are equivalent, as is something like,

shared static this()
{
    auto router = Vibrant;

    router.Get("/hello", (req, res) => "Hello user!");
}
bubnenkoff commented 9 years ago

thanks, but how to specify port number?

2015-07-05 19:07 GMT+03:00 Mihail K notifications@github.com:

Aye, I'll add a comparison in the README. One was originally present, but I removed it because it was fairly long on vibe.d's side of things.

Also, yes. Those are equivalent, as is something like,

shared static this() { auto router = Vibrant;

router.Get("/hello", (req, res) => "Hello user!");

}

— Reply to this email directly or view it on GitHub https://github.com/Mihail-K/vibrant.d/issues/1#issuecomment-118635493.

mintyfresh commented 9 years ago

You can specify a port in two ways. The short way is to supply it as a parameter,

with(Vibrant(8080))
{
}

However, you can also pass in an HTTPServerSettings object, if you so choose.

auto settings = new HTTPServerSettings;
settings.port = 8080;

with(Vibrant(settings))
{
}