Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!