Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
Specifying content-type for static resources in Nuxt

Using the built-in Nuxt server, I would like to serve the static file /.well-known/apple-app-site-association with content-type application/json. However, as the file doesn't have a .json file extension the content-type is returned as application/octet-stream. Is it possible to set some specific config for this file/route to return the content-type?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

After examining the source of serve-static and then looking at the source of the nuxt.js static file integration I eventually figured it out.

I added the following property to nuxt.config.js:

    render: {
        static: {
            setHeaders: (resp, path) => {
                if (
                    resp.req.originalUrl ===
                    '/.well-known/apple-app-site-association'
                ) {
                    resp.setHeader('Content-Type', 'application/json')
                }
            },
        },
    }

This property is referenced in the nuxt.js docs but not from the static directory docs.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda