Skip to content

proxy assets #3

@uleodolter

Description

@uleodolter

currently assets are not handled when running in proxy mode ( npm run start:proxy )

i tried to replace library-logo.png and placed custom logo in src/assets/images/library-logo.png

after running in proxy mode i can access the logo from http://localhost:4201/assets/images/library-logo.png

when accessing http://localhost:4201/nde/home?vid=... the logo location looks like http://localhost:4201/nde/assets/images/library-logo.png

therefore i tried to modify proxy/proxy.conf.mjs and added

  {
    context: [
      '/nde/assets/**'
    ],
    target: 'not-needed',
    router: (req) => {
      const url = `${req.protocol}://${req.get('host')}`
      console.log(url);
      return url;

    },
    secure: true,
    logLevel: 'debug',
    pathRewrite: { '^/nde/assets/': '/assets/' },

  },

this resulted to proxy all assets, the local library logo is shown correctly, but all other default assets are missing.

how can we proxy local assets (if they exist, .e.g. library-logo.png, homepage.css, homepage_de.html, ...) and still access missing assets from default location (alma/primo platform) ?

this would be great for developing / testing the customization of the home page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions