"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = void 0;
const __1 = require("..");
const create_redis_1 = require("../shared/create-redis");
async function run(backend, config) {
    var _a;
    const redisFactory = (0, create_redis_1.createRedisFactory)(backend === "Redis"
        ? (_a = process.env.REDIS_URL) !== null && _a !== void 0 ? _a : "redis://localhost:6379"
        : undefined);
    const { httpServer, close, server } = await (0, __1.runQuirrel)({
        port: 0,
        redisFactory,
        disableTelemetry: true,
        logger: "none",
        ...config,
    });
    const redis = redisFactory();
    return {
        teardown: close,
        server: httpServer,
        app: server,
        redis,
    };
}
exports.run = run;
//# sourceMappingURL=runQuirrel.js.map