public rootRequestHandler()

in src/models/sqlOutputContentProvider.ts [86:126]


    public rootRequestHandler(req, res): void {
        let uri: string = req.query.uri;
        if (this._queryResultsMap.has(uri)) {
            clearTimeout(this._queryResultsMap.get(uri).timeout);
        }
        let theme: string = req.query.theme;
        let backgroundcolor: string = req.query.backgroundcolor;
        let color: string = req.query.color;
        let prod;
        try {
            fs.accessSync(path.join(LocalWebService.staticContentPath, Constants.contentProviderMinFile), fs.F_OK);
            prod = true;
        } catch (e) {
            prod = false;
        }
        let queryUri: string;
        if (this._queryResultsMap.has(uri)) {
            queryUri = this._queryResultsMap.get(uri).queryRunner.uri;
        }
        let pgsqlConfig = this._vscodeWrapper.getConfiguration(Constants.extensionName, queryUri);
        let editorConfig = this._vscodeWrapper.getConfiguration('editor', queryUri);
        let extensionFontFamily = pgsqlConfig.get<string>(Constants.extConfigResultFontFamily).split('\'').join('').split('"').join('');
        let extensionFontSize = pgsqlConfig.get<number>(Constants.extConfigResultFontSize);
        let fontfamily = extensionFontFamily ?
                            extensionFontFamily :
                            editorConfig.get<string>('fontFamily').split('\'').join('').split('"').join('');
        let fontsize = extensionFontSize ? extensionFontSize + 'px' : editorConfig.get<number>('fontSize') + 'px';
        let fontweight = editorConfig.get<string>('fontWeight');
        res.render(path.join(LocalWebService.staticContentPath, Constants.msgContentProviderSqlOutputHtml),
            {
                uri: uri,
                theme: theme,
                backgroundcolor: backgroundcolor,
                color: color,
                fontfamily: fontfamily,
                fontsize: fontsize,
                fontweight: fontweight,
                prod: prod
            }
        );
    }