diff --git a/index.js b/index.js index 9fe13ce..7adadfa 100644 --- a/index.js +++ b/index.js @@ -88,6 +88,8 @@ function bootstrapContext(db, structureId, routeId, initContext) { // todo wrap template in data-bliss-edit-template thing since ws can't take us to the editor on a component basis?? maybe... // for now just designing with component approach const eta = model.getTemplater(structureId); + const structure = model.getStructure(db, structureId) + const __urlPrefix = structure.route_prefix; const libs = { eta, db: getDb, push: webPush, files: { saveFile: (...args) => saveFile(structureId, ...args) } }; @@ -120,7 +122,10 @@ function bootstrapContext(db, structureId, routeId, initContext) { vapidPublicKey: vapidPublicKey, fetch: fetch, clearTimeout: clearTimeout, - setTimeout: setTimeout + setTimeout: setTimeout, + route: function (url) { + return __urlPrefix ? path.join(__urlPrefix, url) : url; + }, }); for (let appDb of dbs) { let dbInstance = model.getDbInstance(appDb.id); diff --git a/out.mp3 b/out.mp3 new file mode 100644 index 0000000..7eab93b Binary files /dev/null and b/out.mp3 differ