Document how to also make Koa match Nuxt's router.base

renoirb
40
renoirb
commented a year ago

Assuming a project needs to have both Nuxt and Koa to answer to non-root routes, it is unclear how we can make Koa also support setting a baseUrl to something else than root / (e.g. /foo/).

Use case

Ability to support running production build to something else than root /.

// nuxt.config.js
module.exports = {
  router: {
    base: '/foo/'
  }
}

As documented in nuxt.js/…/configuration-router

Issue

Koa has no way of knowing the setting change.

TODO

  1. Setup sample repository (see renoirb/experiments-nuxt-koa-env-runtime-201806, branch rework-hare-20180619 as a starting point)
0
renoirb
40
renoirb
commented a year ago

(tagging Clark Du, for reference)

Maybe @clarkdo has an idea about this, since nuxt/koa-template and clarkdo/hare both use Koa alongside Nuxt.

Also, maybe that should be a feature-request, and not be considered a "need help" question.

0
clarkdo
10.8k
clarkdo
commented a year ago

Should be a feature request, since we’re going to integrate templates into create-nuxt-app, so could you open a feature request ticket there?

0
renoirb
40
renoirb
commented a year ago

/me proposes closing this issue.

0
Informations
QuestionUnresolved
#c29 - Created a year ago