@ -26,8 +27,9 @@ function createProxyServer(domain, inPort, outPort) {
"}"
);
shell.mkdir('-p',npath.enabledSites());// Creates directory if doesn't exist
shell.ln('-sf',conf(npath.availableSites(),domain,outPort),conf(npath.enabledSites(),domain,outPort));// Symlink the conf file from sites-available to sites-enabled
shell.ln('-sf',conf(npath.confD(),domain,outPort),conf(npath.enabledSites(),domain,outPort));// Symlink the conf file from sites-available to sites-enabled
@ -11,7 +11,7 @@ var EOL = require('os').EOL; // \n if used on Linux, \r\n if used on Windows.
functioncreateStaticServer(domain,outPort){
outPort=outPort||80;
fs.outputFileSync((conf(npath.availableSites(),domain,outPort)),// Gets nginx's paths from nginxPath.js
fs.outputFileSync((conf(npath.confD(),domain,outPort)),// Gets nginx's paths from nginxPath.js
"server {"+EOL+
" listen "+outPort+";"+EOL+
" listen [::]:"+outPort+";"+EOL+
@ -26,11 +26,12 @@ function createStaticServer(domain, outPort) {
);
shell.mkdir('-p',npath.enabledSites());// Creates directory if doesn't exist
shell.rm('-rf',conf(npath.enabledSites(),domain,outPort));// Removes domain from sites-enabled if exists
shell.ln('-sf',conf(npath.availableSites(),domain,outPort),conf(npath.enabledSites(),domain,outPort));// Symlink the conf file from sites-available to sites-enabled
shell.ln('-sf',conf(npath.confD(),domain,outPort),conf(npath.enabledSites(),domain,outPort));// Symlink the conf file from sites-available to sites-enabled
shell.rm('-rf',npath.webRootDomain(domain,outPort));// Removes domain from webroot if exists
shell.mkdir('-p',npath.webRoot());// Creating the nginx www path if it doesn't exist so symlink doesn't fail
shell.ln('-sf',currentPath,npath.webRootDomain(domain,outPort));// Symlink current directory to nginx's web root
// Check for requirements such as OS version and nginx install. Throw and exit if requirements not found. #Roadmap: Add ability to satisfy any possible requirements.
requirements();// Comment in development and uncomment this line in production. This should check whether the OS is compatible with this version of `up`
@ -28,7 +33,7 @@ program
if(!validate(domain,outPort))return;//Validates domain and outport, and if invalid, throws and returns.