@piggly/fastify-chassis
Version:
An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.
17 lines • 426 B
JavaScript
/**
* Mount an URL based on a base and a relative path.
*
* @param {string} base
* @param {string} relative_path
* @returns {string}
* @since 1.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
export const mountURL = (base, relative_path) => {
let path = relative_path;
if (path.startsWith('/')) {
path = path.substring(1);
}
return `${base}/${path}`;
};
//# sourceMappingURL=global.js.map