コード例 #1
0
ファイル: server.c プロジェクト: gamman/appweb-4
static void openHandlers(Http *http)
{
#if BLD_FEATURE_DIR
    maOpenDirHandler(http);
#endif
    maOpenFileHandler(http);
}
コード例 #2
0
ファイル: server.c プロジェクト: doghell/appweb-4
/*
    Create the top level appweb control object. This is typically a singleton.
 */
PUBLIC MaAppweb *maCreateAppweb()
{
    MaAppweb    *appweb;
    Http        *http;

    if ((appweb = mprAllocObj(MaAppweb, manageAppweb)) == NULL) {
        return 0;
    }
    MPR->appwebService = appweb;
    appweb->http = http = httpCreate(HTTP_CLIENT_SIDE | HTTP_SERVER_SIDE);
    httpSetContext(http, appweb);
    appweb->servers = mprCreateList(-1, 0);
    appweb->localPlatform = slower(sfmt("%s-%s-%s", BIT_OS, BIT_CPU, BIT_PROFILE));
    maSetPlatform(NULL);
    maGetUserGroup(appweb);
    maParseInit(appweb);
    /* 
       Open the builtin handlers 
     */
#if BIT_PACK_DIR
    maOpenDirHandler(http);
#endif
    maOpenFileHandler(http);
    return appweb; 
}