typescript(translucid): deprecations
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
39afed78dc
commit
62bf58898e
|
@ -30,7 +30,7 @@ connect.then(() => {
|
||||||
```
|
```
|
||||||
The translucid object can be used to make file bindings:
|
The translucid object can be used to make file bindings:
|
||||||
```
|
```
|
||||||
translucid.bind("/","client/index.html",true,["myId"]);
|
translucid.bind("/","client/index.html",["myId"]);
|
||||||
```
|
```
|
||||||
Then you can add middleware like this:
|
Then you can add middleware like this:
|
||||||
```
|
```
|
||||||
|
|
|
@ -16,12 +16,8 @@ class Translucid {
|
||||||
use(obj) {
|
use(obj) {
|
||||||
this.midleware.push(obj);
|
this.midleware.push(obj);
|
||||||
}
|
}
|
||||||
bind(path = "/", filepath = "", text = false, classes = []) {
|
bind(path = "/", filepath = "", classes = []) {
|
||||||
this.app.get(path, async (req, res) => {
|
this.app.get(path, async (req, res) => {
|
||||||
if (!text) {
|
|
||||||
console.error("Blocking reading acces s deprecated, and would be remove in the next version.");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const readResults = await read_1.read(filepath);
|
const readResults = await read_1.read(filepath);
|
||||||
const toRun = [];
|
const toRun = [];
|
||||||
for (let i of this.midleware) {
|
for (let i of this.midleware) {
|
||||||
|
@ -40,7 +36,6 @@ class Translucid {
|
||||||
res.send(prev);
|
res.send(prev);
|
||||||
});
|
});
|
||||||
decorated[0](readResults);
|
decorated[0](readResults);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue