feat: Migrate file storage to unified data directory
This commit is contained in:
+2
-10
@@ -80,13 +80,13 @@ const serveStatic = async (prefix, getPathSegment, req, res) => {
|
||||
return readStream.pipe(res);
|
||||
};
|
||||
|
||||
const publicStaticDirServer = (prefix, getPathSegment) => (req, res, next) => {
|
||||
/* const publicStaticDirServer = (prefix, getPathSegment) => (req, res, next) => {
|
||||
if (!req.url.startsWith(prefix)) {
|
||||
return next();
|
||||
}
|
||||
|
||||
return serveStatic(prefix, getPathSegment, req, res);
|
||||
};
|
||||
}; */
|
||||
|
||||
const protectedStaticDirServer = (prefix, getPathSegment) => (req, res, next) => {
|
||||
if (!req.url.startsWith(prefix)) {
|
||||
@@ -235,14 +235,6 @@ module.exports.routes = {
|
||||
|
||||
'PATCH /api/_internal/config': '_internal/update-config',
|
||||
|
||||
'GET /preloaded-favicons/*': {
|
||||
fn: publicStaticDirServer(
|
||||
'/preloaded-favicons',
|
||||
() => sails.config.custom.preloadedFaviconsPathSegment,
|
||||
),
|
||||
skipAssets: false,
|
||||
},
|
||||
|
||||
'GET /favicons/*': {
|
||||
fn: protectedStaticDirServer('/favicons', () => sails.config.custom.faviconsPathSegment),
|
||||
skipAssets: false,
|
||||
|
||||
Reference in New Issue
Block a user