Skip to content

TypeError: Cannot read property 'link' of undefined #8

Open
@aashutoshrathi

Description

@aashutoshrathi

I'm getting this error while using the README code.

const HorribleSubsApi = require("horriblesubs-api");

// Create a new instance of the module.
const horriblesubs = new HorribleSubsApi({ baseUrl: "https://horriblesubs.info/" });

app.use(express.static("public"));

// https://expressjs.com/en/starter/basic-routing.html
app.get("/", (request, res) => {
  horriblesubs
    .getAllAnime()
    .then(res => {
      const [data] = res;
      console.log(data);

      // Get data including episodes from horriblesubs.
      res.send(horriblesubs.getAnimeData(data));
    })
    .then(res => console.log(res))
    .catch(err => console.error(err));
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions