Deploy Nuxt on Layer0

Layer0 supports universal (SSR) Nuxt.js applications.

Layer0 is an all-in-one platform to develop, deploy, preview, experiment on, monitor, and run your headless frontend. It is focused on large, dynamic websites and best-in-class performance through EdgeJS (a JavaScript-based Content Delivery Network), predictive prefetching, and performance monitoring. Layer0 offers a free tier.

For detailed instructions consult the Layer0 Nuxt.js documentation.

Getting Started

  1. Sign up for a free account on Layer0's signup page.

  2. Install the Layer0 CLI

yarn global add @layer0/cli
npm i -g @layer0/cli

Configure your project

  1. Make sure server side rendering is enabled and in your nuxt.config.js add the @layer0/nuxt module:
// nuxt.config.js

module.exports = {
  modules: ['@layer0/nuxt/module']
}
  1. Run layer0 init which will configure your project for Layer0.

Running and deploying your project

  1. To test your app locally, run the following in your project directory:
layer0 run
  1. To deploy your app, run the following in your project directory:
layer0 deploy

Optimize your project's performance

  • (Optional) To optimize the performance of server side rendering in Nuxt.js, Layer0 recommends moving most your modules into buildModules as described in the modules vs buildModules section of the Layer0 Nuxt.js guide.
  • (Optional) Layer0 automatically supports Nuxt.js's built-in routing scheme. However you can and should optimize the performance by customizing the routing, caching, and prefetching via EdgeJS as shown in the Routing section of the Layer0 Nuxt.js guide.

Get help

If you have issues please check the Troubleshooting section of the guide or create a ticket in the forums.

Contributors

Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!