This plugin simply uses an external API to add two numbers via a GET request to localhost:3001/api/calculate
, but is simply an
example to demonstrate a custom plugin to reach out to external APIs.
Assume a GET /calculate
api like so
app.get("/calculate", async (request, response) => {
const { n1, n2 } = request.query;
const addition = Number(n1) + Number(n2);