mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 05:38:58 +01:00
add a check if json variable exists or not
Signed-off-by: Ashley <iamashley@duck.com>
This commit is contained in:
parent
53fcc21fab
commit
779e85441f
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