fix(backend): correct app favicon path
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
79fb62d409
commit
31403b7020
@@ -16,7 +16,7 @@
|
||||
"db:migration:create": "knex migrate:make",
|
||||
"db:rollback": "knex migrate:rollback",
|
||||
"db:migrate": "knex migrate:latest",
|
||||
"copy-statics": "copyfiles src/**/*.{graphql,json} dist"
|
||||
"copy-statics": "copyfiles src/**/*.{graphql,json,svg} dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@automatisch/web": "0.1.0",
|
||||
|
@@ -5,9 +5,19 @@ const appAssetsHandler = async (app: Application) => {
|
||||
const appNames = App.list;
|
||||
|
||||
appNames.forEach(appName => {
|
||||
const svgPath = `${__dirname}/../apps/${appName}/assets/favicon.svg`;
|
||||
const staticFileHandlerOptions = {
|
||||
/**
|
||||
* Disabling fallthrough is important to respond with HTTP 404.
|
||||
* Otherwise, web app might be served.
|
||||
*/
|
||||
fallthrough: false,
|
||||
};
|
||||
const staticFileHandler = express.static(svgPath, staticFileHandlerOptions);
|
||||
|
||||
app.use(
|
||||
`/apps/${appName}/assets/favicon.svg`,
|
||||
express.static(`src/apps/${appName}/assets/favicon.svg`)
|
||||
staticFileHandler
|
||||
)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user