mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-28 19:29:03 +01:00
add a check if json variable exists or not
Signed-off-by: Ashley <iamashley@duck.com>
This commit is contained in:
parent
29cf785969
commit
ab1bb9bd45
1 changed files with 20 additions and 15 deletions
|
@ -119,6 +119,10 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
let url;
|
let url;
|
||||||
if (j_.URL != undefined) url = j_.URL;
|
if (j_.URL != undefined) url = j_.URL;
|
||||||
|
|
||||||
|
//checks if json exists
|
||||||
|
if (json) {
|
||||||
|
//checks if title exists in the json object
|
||||||
|
|
||||||
if ("Title" in json) {
|
if ("Title" in json) {
|
||||||
// json response
|
// json response
|
||||||
const re = {
|
const re = {
|
||||||
|
@ -136,6 +140,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
|
|
||||||
res.json(re);
|
res.json(re);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/watch", async function (req, res) {
|
app.get("/watch", async function (req, res) {
|
||||||
|
|
Loading…
Reference in a new issue