javascript自动执行功能

时间:2017-09-02 11:39:11

标签: javascript node.js function

我无法理解这个功能。我理解身体的一部分。但是为什么功能变得全球化以及出口后它做了什么?

(function(global) {
    "use strict;"

    // Class ------------------------------------------------
    var Config = {};

    Config.host = "45.55.81.215";
    Config.port = 80;
    Config.urlPrefix = '/spika';
    Config.socketNameSpace = '/spika';

    Config.imageDownloadURL = "http://" + Config.host + "/:" + Config.port + Config.urlPrefix + "/media/images/";
    Config.noavatarImg = "http://" + Config.host + ":" + Config.port + Config.urlPrefix + "/img/noavatar.png";

    Config.chatDatabaseUrl = "mongodb://localhost/simplemessenger";
    Config.dbCollectionPrefix = "spika_";

    Config.uploadDir = 'public/uploads/';
    Config.sendAttendanceMessage = true;

    Config.stickerBaseURL = 'http://spika.chat';
    Config.stickerAPI = Config.stickerBaseURL + '/api/v2/stickers/56e005b1695213295419f5df';

    // Exports ----------------------------------------------
    module["exports"] = Config;

})((this || 0).self || global);

0 个答案:

没有答案