Last active
June 7, 2023 22:24
-
-
Save joshatxantie/055152896464211fec214752349e1493 to your computer and use it in GitHub Desktop.
PowerBI Node.js Express Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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