express icon indicating copy to clipboard operation
express copied to clipboard

Images not served properly

Open Pato94 opened this issue 5 years ago • 3 comments

I'm experiencing the same issue described here. I'd like to test this solution, but right now I'm using this component, and as far as I know it does not provide any configuration to specify these content-types.

I looked into this file and I noticed the server is not being created with any parameter.

My workaround is going to be not using this component and creating the server myself, but I'd like to use this component in the future. Is it possible to add this content-types as a configuration parameter?

Pato94 avatar Dec 29 '20 15:12 Pato94

I'm also experiencing the same issue with serving images through the express component

gjgd avatar Jan 03 '21 22:01 gjgd

Hey any updates on this ?! I have been pulling out my hair trying to understand why i cant display images.

nemani avatar Apr 08 '21 08:04 nemani

Fixed it! you need to set the env variable for the binary_content_types to change the return for isBinary()

component: express
name: express-starter

inputs:
  src:
    src: ./
    hook: npm run build
    dist: build
  timeout: 30
  memory: 1024
  env:
    FONTCONFIG_PATH: '/var/task/fonts'
    BINARY_CONTENT_TYPES: 'image/png, image/jpg'

nemani avatar Apr 09 '21 06:04 nemani