(function(){ 'use strict'; var DIR = __dirname + '/', main = require(DIR + 'lib/server/main'), LIBDIR = main.LIBDIR, SRVDIR = main.SRVDIR, CLIENTDIR = LIBDIR + 'client', path = main.path, fs = main.fs, CloudFunc = main.cloudfunc, Util = main.util, update = main.update, Server = main.require(LIBDIR + 'server'), Minify = Server.Minify, srv = Server.CloudServer, Config = main.config, REQUEST = 'request', RESPONSE = 'response', INDEX = DIR + 'html' + main.SLASH + 'index.html'; /* reinit main dir os if we on * Win32 should be backslashes */ DIR = main.DIR; readConfig(); Server.start(Config, { appcache : appCacheProcessing, index : indexProcessing, minimize : minimize, rest : rest, route : route }); if(update) update.get(); /** * additional processing of index file */ function indexProcessing(pData){ var lReplace_s, lData = pData.data, lAdditional = pData.additional; /* * если выбрана опция минимизировать скрипты * меняем в index.html обычные css на * минифицированый */ if(Minify.allowed.css){ var lPath = '/' + Minify.MinFolder.replace(DIR, ''); lReplace_s = ''; lData = Util.removeStr(lData, lReplace_s) .replace('/css/style.css', lPath + 'all.min.css'); } /* меняем title */ lReplace_s = '