github remix-run/remix static-middleware@0.2.0
static-middleware v0.2.0

latest release: interaction@0.3.0
6 hours ago
  • Read the request method from context.method instead of context.request.method, so it's compatible with the method-override middleware

  • Add @remix-run/fs as a peer dependency. This package now imports from @remix-run/fs instead of @remix-run/lazy-file/fs.

  • Add index option to configure which files to serve when a directory is requested. When a request targets a directory, the middleware will try each index file in order until one is found. Defaults to ['index.html', 'index.htm']. Supports boolean shortcuts: true for defaults, false to disable.

    // Serve index.html from directories by default
    staticFiles('./public')
    
    // Custom index files
    staticFiles('./public', {
      index: ['default.html', 'home.html'],
    })
    
    // Disable index file serving
    staticFiles('./public', { index: false })
    staticFiles('./public', { index: [] })

Don't miss a new remix release

NewReleases is sending notifications on new releases.