diff --git a/typescript/translucid/Translucid.js b/typescript/translucid/Translucid.js index 85d6479..1bb5750 100644 --- a/typescript/translucid/Translucid.js +++ b/typescript/translucid/Translucid.js @@ -25,12 +25,13 @@ class Translucid { const object = JSON.parse(json); for (let i in object) { const classes = object[i].classes || []; - this.bind(i, object[i].file, classes); - //gotta comment this later - // console.log(`Binded room with name ${i} and path ${object[i].file} with classes ${classes}`) + const sendAsFiles = object[i].sendFiles; + if (sendFiles != false) + sendFiles = true; + this.bind(i, object[i].file, classes, sendFiles); } } - bind(path = "/", filepath = "", classes = [], sendFiles = false) { + bind(path = "/", filepath = "", classes = [], sendFiles = true) { this.app.get(path, async (req, res) => { const readResults = await read_1.read(filepath); const toRun = []; diff --git a/typescript/translucid/Translucid.ts b/typescript/translucid/Translucid.ts index de706fd..3fee2a9 100644 --- a/typescript/translucid/Translucid.ts +++ b/typescript/translucid/Translucid.ts @@ -30,12 +30,12 @@ class Translucid { for (let i in object){ const classes = object[i].classes || []; - this.bind(i,object[i].file,classes); - //gotta comment this later - // console.log(`Binded room with name ${i} and path ${object[i].file} with classes ${classes}`) + const sendAsFiles = object[i].sendFiles; + if (sendFiles != false) sendFiles = true; + this.bind(i,object[i].file,classes,sendFiles); } } - bind(path:string = "/", filepath:string = "", classes:Array = [],sendFiles:boolean=false):void{ + bind(path:string = "/", filepath:string = "", classes:Array = [],sendFiles:boolean=true):void{ this.app.get(path, async (req, res)=> { const readResults = await read(filepath); const toRun:Array = [];