1.1.6 • Published 5 years ago

gatsby-plugin-express v1.1.6

Weekly downloads
1,162
License
ISC
Repository
github
Last release
5 years ago

gatsby-plugin-express

version downloads

Server side client route matching, redirect and 404 handling

Usage

gatsby-config.js

plugins: [
  {
    resolve: 'gatsby-plugin-express',
    options: {
      output: 'config/gatsby-express.json',
    }
  }
]

express app

const gatsyExpress = require('gatsby-plugin-express');
const app = express();

// serve static files before gatsbyExpress
app.use(express.static('public/'));
app.use(gatsyExpress('config/gatsby-express.json', {
  publicDir: 'public/',
  template: 'public/404/index.html',

  // redirects all /path/ to /path
  // should be used with gatsby-plugin-remove-trailing-slashes
  redirectSlashes: true,
}));
1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago