slicejs-web-framework 2.4.5 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +8 -0
- package/package.json +1 -1
package/api/index.js
CHANGED
|
@@ -199,6 +199,14 @@ if (runMode === 'development') {
|
|
|
199
199
|
}
|
|
200
200
|
return res.status(404).send('routes.js not found');
|
|
201
201
|
});
|
|
202
|
+
app.get('/sliceConfig.json', (req, res) => {
|
|
203
|
+
const configPath = path.join(__dirname, `../${folderDeployed}`, 'sliceConfig.json');
|
|
204
|
+
if (fs.existsSync(configPath)) {
|
|
205
|
+
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
206
|
+
return res.send(fs.readFileSync(configPath, 'utf8'));
|
|
207
|
+
}
|
|
208
|
+
return res.status(404).send('sliceConfig.json not found');
|
|
209
|
+
});
|
|
202
210
|
for (const folder of normalizedPublicFolders) {
|
|
203
211
|
app.use(folder, express.static(path.join(__dirname, `../${folderDeployed}`, folder)));
|
|
204
212
|
}
|