Skip to content
Commits on Source (3)
......@@ -68,28 +68,18 @@ export default function initWidgetApi() {
/**
* Load the NPM widget script
*/
WebApp.connectHandlers.use('/scripts/widget.js', async (req, res) => {
WebApp.connectHandlers.use('/scripts/widget.js', (req, res) => {
if (req.method !== 'GET') {
res.writeHead(405);
res.end('Method not allowed');
return;
}
if (!Meteor.settings.public?.widget?.packageUrl) {
res.writeHead(404);
res.end();
return;
}
res.writeHead(200, {
'Content-Type': 'application/javascript',
});
const response = await axios.get(Meteor.settings.public.widget.packageUrl, {
responseType: 'stream',
});
response.data.pipe(res);
res.write(Assets.getText('widget/la-pastille/index.umd.js'));
res.end();
});
/**
......
{
"name": "app",
"version": "5.9.1",
"version": "5.9.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "app",
"version": "5.9.1",
"version": "5.9.2",
"license": "EUPL-1.2",
"dependencies": {
"@babel/runtime": "^7.23.9",
......
{
"name": "app",
"private": true,
"version": "5.9.1",
"version": "5.9.2",
"license": "EUPL-1.2",
"description": "Online service platform",
"author": "EOLE <team@eole.education> - DINUM",
......
# Changelog
## [5.9.2](https://gitlab.mim-libre.fr/alphabet/laboite/compare/release/5.9.1...release/5.9.2) (2024-10-07)
### Bug Fixes
* **widget:** /scripts/widget.js returns local widget script ([d067423](https://gitlab.mim-libre.fr/alphabet/laboite/commit/d067423234ca71a290b43f6533f90db77a7143df))
## [5.9.1](https://gitlab.mim-libre.fr/alphabet/laboite/compare/release/5.9.0...release/5.9.1) (2024-07-05)
......