initial commit

This commit is contained in:
JJ Kasper
2018-05-17 14:31:05 -05:00
commit 2c90d2e7dd
79 changed files with 10684 additions and 0 deletions

15
util/getUrl.js Normal file
View File

@@ -0,0 +1,15 @@
const url = require('url');
const urljoin = require('url-join');
const basePath = require('./basePath');
const { host, port, protocol } = require('../config/host.json');
module.exports = (path, absolute) => {
path = urljoin(basePath, path);
if(!absolute) return path;
return url.format({
hostname: host,
port,
protocol,
pathname: path,
});
};