HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/zaklada/html/node_modules/browser-sync/dist/server/static-server.js
var serverUtils = require("./utils.js");
var resolve = require("path").resolve;
var utils = require("../utils.js");
var serveStatic = require("./serve-static-wrapper").default();
var serveIndex = require("serve-index");
/**
 * @param {BrowserSync} bs
 * @returns {*}
 */
module.exports = function createServer(bs) {
    var options = bs.options;
    var server = options.get("server");
    var basedirs = utils.arrayify(server.get("baseDir"));
    var serveStaticOptions = server.get("serveStaticOptions").toJS(); // passed to 3rd party
    var _serveStatic = 0;
    var _routes = 0;
    bs.options = bs.options
        /**
         * Add directory Middleware if given in server.directory
         */
        .update("middleware", function (mw) {
        if (!server.get("directory")) {
            return mw;
        }
        return mw.concat({
            route: "",
            handle: serveIndex(resolve(basedirs[0]), {
                icons: true,
                view: "details"
            }),
            id: "Browsersync Server Directory Middleware"
        });
    })
        /**
         * Add middleware for server.baseDir Option
         */
        .update("middleware", function (mw) {
        return mw.concat(basedirs.map(function (root) {
            return {
                route: "",
                id: "Browsersync Server ServeStatic Middleware - " +
                    _serveStatic++,
                handle: serveStatic(resolve(root), serveStaticOptions)
            };
        }));
    })
        /**
         * Add middleware for server.routes
         */
        .update("middleware", function (mw) {
        if (!server.get("routes")) {
            return mw;
        }
        return mw.concat(server.get("routes").map(function (root, urlPath) {
            // strip trailing slash
            if (urlPath[urlPath.length - 1] === "/") {
                urlPath = urlPath.slice(0, -1);
            }
            return {
                route: urlPath,
                id: "Browsersync Server Routes Middleware - " +
                    _routes++,
                handle: serveStatic(resolve(root))
            };
        }));
    });
    var app = serverUtils.getBaseApp(bs);
    /**
     * Finally, return the server + App
     */
    return serverUtils.getServer(app, bs.options);
};
//# sourceMappingURL=static-server.js.map