Premise / What I want to achieve
I'm deploying a Nuxt.js app in SSR mode on Google App Engine. At the time, the favicon is no longer displayed, so I want to be able to display it.
yarn build + gcloud app deploy
By the way, it was displayed without any problem with the following command.
yarn dev
yarn build + yarn start
Corresponding source code
export default = {
head: {
link: [
{ rel: 'icon',
type: 'image/x-icon', href: 'images/favicon.ico' }
]
}
}(nuxt.config.js)
runtime: nodejs12
instance_class: F2
handlers:
- url: /_nuxt
static_dir: .nuxt/dist/client
secure: always
- url: /(.*\.(gif|png|jpg|ico|txt))$
static_files: static/\1
upload: static/.*\.(gif|png|jpg|ico|txt)$
secure: always
- url: /sw.js
static_files: static/sw.js
upload: static/sw.js
- url: /.*
script: auto
secure: always
- url: /images/favicon.ico
static_files: static/images/favicon.ico
upload: static/images/favicon.ico
- url: /assets
static_dir: assets
env_variables:
HOST: '0.0.0.0'
PORT: '8080'(app.yaml)
I placed the favicon.ico under the static / images directory.