RejectedSoftware Forums

Sign up

custom main()

Hello,

I was trying to get a custom main function working, but I've run into a little bit of a snag...
I imported vibe.vibe and the server starts, but my simple html page isn't showing up:

// code
import vibe.vibe; // version 0.7.8
static this() {...}
int main(string[] args){

writeln(args);
logInfo("Running event loop...");
try {
    return runEventLoop();
} catch( Throwable th ){
    logError("Unhandled exception in event loop: %s", th.toString());
    return 1;
}

}
// output:
[1101FDE01:00000000 INF] Updating application in '/Users/joshuaniehus/vibe/projects/simple'
[1101FDE01:00000000 INF] You are up to date
["/tmp/.rdmd-501/rdmd-app.d-1E3E51D14594E56ACA887FDEDF593E46/app"]
[10B3D5E01:00000000 INF] Running event loop...

Could this be a Privilege lowering issue? If so, should I create a vibe.conf file in my proj dir?

Thanks,
Josh

Re: custom main()

Sorry that's a left-over of integrating vibedist support. You need to
call vibe.http.server.startListening() before running the event loop.

I'm not sure yet if this will stay or if it will be automatically done.
This is also the reason, why I missed to document it.

Re: custom main()

On Sun, 07 Oct 2012 09:47:15 +0200, Sönke Ludwig wrote:

Sorry that's a left-over of integrating vibedist support. You need to
call vibe.http.server.startListening() before running the event loop.

I'm not sure yet if this will stay or if it will be automatically done.
This is also the reason, why I missed to document it.

Cool, I'm up and running, thanks