Skip to content

Instantly share code, notes, and snippets.

@joshatxantie
Last active June 7, 2023 22:24
Show Gist options
  • Save joshatxantie/055152896464211fec214752349e1493 to your computer and use it in GitHub Desktop.
Save joshatxantie/055152896464211fec214752349e1493 to your computer and use it in GitHub Desktop.
PowerBI Node.js Express Controller
const PowerBiService = require("../path/to/powerbi.service.js");
module.exports.getEmbedInfo = async (req, res) => {
// Get the details like Embed URL, Access token and Expiry
try {
let result = await PowerBiService.getEmbedInfo(
"", // Workspace Id
[""] // Report Id
);
res.status(result.status).send(result);
// result.status specified the statusCode that will be sent along with the result object
} catch (e) {
console.log(e);
res.status(500).send(e);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment