"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
const server_1 = require("@methodus/server");
const describeView_1 = require("./describeView");
function init(config) {
    process.env.describe_route = process.env.describe_route || '';
    const describePath = process.env.describe_route + '/describe';
    config.run('express', {
        onStart: (instance) => {
            var options = {
                default: ['index.html'],
                //dotfiles: 'ignore',
                etag: true,
                extensions: ['htm', 'ico', 'html', 'gif',
                    'ogg', 'mp3', 'png', 'wav',
                    'js', 'js.map', 'css', 'json', 'cur',
                    'woff', 'eot', 'svg', 'ttf'],
                maxAge: '1d',
                redirect: false,
                setHeaders: function (res, path, stat) {
                    res.set('x-timestamp', Date.now());
                }
            };
            const clientDir = path.resolve(path.join(__dirname, '..', 'public'));
            instance.use(describePath, server_1.BuiltInServers.Express.static(clientDir, options));
            const methodClientPath = path.join(process.cwd(), 'node_modules', '@methodus/client', 'dist');
            instance.use(`${describePath}/scripts/`, server_1.BuiltInServers.Express.static(methodClientPath, options));
        }
    });
    config.use(describeView_1.DescribeView, 'Local', "express" /* Express */);
    return config;
}
exports.init = init;
//# sourceMappingURL=index.js.map