forest-express
Version:
Official package for all Forest Express Lianas
19 lines (17 loc) • 684 B
JavaScript
;
exports.generate = function (path, options) {
var pathPrefix = options.expressParentApp ? '/' : '/forest/';
return pathPrefix + path;
};
exports.generateForInit = function (path, options) {
if (options.expressParentApp) return "/".concat(path);
var pathPrefix = '/forest';
return ["".concat(pathPrefix), "".concat(pathPrefix, "/").concat(path)];
};
exports.generateForSmartActionCustomEndpoint = function (path, options) {
if (options.expressParentApp) {
return path.replace(/^\/?forest\//, '/');
}
// NOTICE: Automatically fix missing / character at the beginning at the endpoint declaration.
return path[0] === '/' ? path : "/".concat(path);
};