Page traduite Le contenu de cette page peut être déprécié.
Deploy Nuxt on Layer0
How to deploy Nuxt app on Layer0?
Layer0 supports universal (SSR) Nuxt 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 documentation .
Getting Started
- Sign up for a free account on Layer0's signup page .
- Install the Layer0 CLI
Yarn
yarn global add @layer0/cli
NPM
npm i -g @layer0/cli
Configure your project
-
Make sure server side rendering is enabled and in your
nuxt.config.jsadd the@layer0/nuxtmodule:
// nuxt.config.js
module.exports = {
modules: ['@layer0/nuxt/module']
}
-
Run
layer0 initwhich will configure your project for Layer0.
Running and deploying your project
- To test your app locally, run the following in your project directory:
layer0 run
- 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, Layer0 recommends moving most your modules into
buildModulesas described in the modules vs buildModules section of the Layer0 Nuxt guide. - (Optional) Layer0 automatically supports Nuxt'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 guide.
Get help
If you have issues please check the Troubleshooting section of the guide or create a ticket in the forums .
Editer cette page sur GitHub
Mise à jour le lun. 28 février 2022
Leoš Literák
Trizotti
Clément Ollivier
Sébastien Chopin
Marcello Bachechi
Rodolphe
Thomas Underwood
Shek Evgeniy
felipesuri
Lukasz Formela
Hugo Torzuoli
Sylvain Marroufin
Kareem Dabbeet
tramplay
Daniel Roe
verebelyicsaba
Adam
Nate Butler
Sandra Rodgers
Arpit Patidar
Matthew Kuehn
Steven DUBOIS
Travis Lindsey
syagawa
Maxime
かる
Al Power
Florent Delerue
quanghm
José Manuel Casani Guerra
Unai Mengual
kazuya kawaguchi
Michael Lynch
Tomachi
pooya parsa
Meir Roth
Brett
Adam Miedema
Thomas Bnt
Kazuki Furukawa
Anthony Ruelle
Christophe Carvalho Vilas-Boas
Roman Harmyder