mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 14:48:33 +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;
|
||||
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) {
|
||||
// json response
|
||||
const re = {
|
||||
|
@ -136,6 +140,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
|
||||
res.json(re);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/watch", async function (req, res) {
|
||||
|
|
Loading…
Reference in a new issue