Ejemplo n.º 1
0
	/**
	 * Resolves a relative path to a absolute url
	 * @param {string} what
	 * @returns {string} url
	 */
	resolve (what) {
		var isAbsolute = (what.indexOf("://") > -1);
		var fullpath;

		if (isAbsolute) {
			return what;
		}

		fullpath = path.resolve(this.directory, what);
		return this.origin + fullpath;
	}
Ejemplo n.º 2
0
	/**
	 * Resolve a path against the directory of the Path
	 *
	 * https://nodejs.org/api/path.html#path_path_resolve_paths
	 * @param	{string} what
	 * @returns {string} resolved
	 */
	resolve (what) {
		return path.resolve(this.directory, what);
	}