A cli tool to quickly create and manage nginx server blocks. https://up.js.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
733 B

'use strict';
// These functions just return paths.
// Later, these should be modified to poll from nginx's config.
const npath = "/etc/nginx/";
const enabled = npath + "sites-enabled/";
const confDpath = npath + "conf.d/";
const upPath = "/etc/up-serve/";
const wwwRoot = upPath + "static/";
const serverListPath = upPath + "servers";
const nginxPath = () => npath;
module.exports = nginxPath;
module.exports.enabledSites = () => enabled;
module.exports.confD = () => confDpath;
module.exports.webRoot = () => wwwRoot;
module.exports.webRootDomain =
(domain, outPort) =>
wwwRoot + domain + '.' + outPort;
module.exports.serversUp = () => serverListPath + '.up';
module.exports.serversBakUp = () => serverListPath + '.bak.up';