ProjectEvergreen / greenwood

Greenwood is your full-stack workbench for the web, focused on supporting modern web standards and development to help you create your next project.
https://www.greenwoodjs.io
MIT License
95 stars 9 forks source link

configuration option for trailing forward slash #1176

Open thescientist13 opened 8 months ago

thescientist13 commented 8 months ago

Type of Change

Coming out of #1116 , one thing that will be useful to have a configuration option for is the trailing forward slash in a URL, e.g.

Different web hosts / servers threat this differently, and not sure if there is also a "canonical" way of instrumenting this, or if it's mostly just for convenience / vanity?

Currently Greenwood assumes / sets a trailing forward slash automatically.

Summary

So the need here would be to enable a configuration option, e.g.

// greenwood.config.js
export default {
  trailingForwardSlash: true|false // default is true
}

At the very least it should be supported in all instances basePath were supported in

  1. The graph
  2. Pages (static and SSR routing)
  3. API Routes
  4. Adapters
  5. GraphQL / Content as data