Community Plugin
View plugin on GitHubGatsby Plugin Express
Introduction
Gatsby plugin for easy integration with Express. gatsby-plugin-express
gives you a way to integrate your Gatsby site
with a Node.js server using Fastify. Use to serve a standard Gatsby.js site normally - the plugin will take care of
everything:
- Serving Static files
- Serving Gatsby functions
- Serving DSG/SSR
routes
- Serving Client-only routes
- Serving 404 page
- Serving 500 page
- Serving Gatsby redirects
- Serving Gatsby reverse proxy (
limited support)
- Path prefix, Etags, and more.
Installation
Install the plugin using npm or yarn
npm i @syfxlin/gatsby-plugin-express express
And add it to your gatsby-config.js
module.exports = {
/* Site config */
plugins: [
{
resolve: `@syfxlin/gatsby-plugin-express`,
},
],
};
Serving your site
This plugin implements a server that’s ready to go. To use this you can configure a start
(or whatever you prefer)
command in your package.json
:
{
"scripts": {
"start": "gserve"
}
}