function startSPA(routesJsonPath) {
    try {
        let baseUrl = require(routesJsonPath).base;
        let rootDir = utils.getLavasProjectRoot();
        let configPath = path.resolve(rootDir, '.lavas/config.json');
        if (fs.pathExistsSync(configPath)) {
            let parsedConfig = JSON.parse(fs.readFileSync(configPath, 'utf8'));
            if (parsedConfig.build.compress) {
                app.use(compression())
            }
        }
        if (!baseUrl || baseUrl === '/') {
            // redirect all requests to '/index.html'
            app.use(historyMiddleware({
                htmlAcceptHeaders: ['text/html'],
                disableDotRule: false // ignore paths with dot inside
            }));

            app.use(express.static('.'));
        }
        else {
            // fix trailing '/'
            // @see https://lavas.baidu.com/guide/v2/advanced/multi-lavas#express-%E5%A4%84%E7%90%86-spa-%E8%B7%AF%E7%94%B1%E7%9A%84%E5%B0%8F%E9%97%AE%E9%A2%98-%E6%89%A9%E5%B1%95
            if (!baseUrl.endsWith('/')) {
                baseUrl += '/';
            }

            app.use('/', (req, res, next) => {
                let requestUrl = req.url.replace(/\?.+?$/, '');

                if (requestUrl === baseUrl.substring(0, baseUrl.length - 1)) {
                    req.url = requestUrl + '/';
                }

                next();
            });

            app.use(baseUrl, historyMiddleware({
                htmlAcceptHeaders: ['text/html'],
                disableDotRule: false // ignore paths with dot inside
            }));

            app.use(baseUrl, express.static('.'));
        }
    }
    catch (e) {}
}
@file server command for lavas
@author mj(zoumiaojiang@gmail.com)