Home / Tutorials / Deploying NuxtJS application to Cloudflare Pages
Deploying NuxtJS application to Cloudflare Pages cover

Deploying NuxtJS application to Cloudflare Pages

Learn how to easily deploy NuxtJS application to Cloudflare Pages and get it serve by Cloudflare world-class infrastructure

6 mins

846

4 years ago

0 comments

Average

In this post, you'll be learning how to deploy/host NuxtJS application to Cloudflare Pages. Although this tutorial is tailored for NuxtJS application, the fundamental is pretty much the same for other front-end projects since the platform itself is built especially to host JAMstack application.
Deploying NuxtJS application to Cloudflare Pages | PostSrc
Cloudflare Pages Homepage

Cloudflare Pages is available for deploying Nuxt applications. The dashboard shown below reflects the interface used when this tutorial was written. Upon registering we are greeted by a screen that can allow us to right away create a project. The process to get started is really painless and it's very easy to get a project up and running.
Deploying NuxtJS application to Cloudflare Pages | PostSrc
Cloudflare Pages Dashboard

NuxtJS Example Application


For the sake of this example, we'll be deploying HackerNews clone built with Nuxt.js which you can directly get the source code from GitHub repository.

The easiest way to prepare the repository is to just fork it rather than cloning the project to the local machine. Since we'll allow Cloudflare pages to retrieve the code that we have just updated on the front-end you'll have to connect it to GitHub and give permission for Cloudflare to access the repository.
Deploying NuxtJS application to Cloudflare Pages | PostSrc
Connect with Github account


Once it's linked, select the repository to be hosted on Cloudflare Pages and in this case the Hackernews NuxtJS project.
Deploying NuxtJS application to Cloudflare Pages | PostSrc
Cloudflare Pages select repository

For the build settings, choose the Nuxt.js preset and this will autofill the build command as well as the output directory to dist.
Deploying NuxtJS application to Cloudflare Pages | PostSrc
Build Settings


By now the site should be deployed on Cloudflare Pages. The original demo is no longer online, but the Nuxt Hacker News source project remains available on GitHub.
Deploying NuxtJS application to Cloudflare Pages | PostSrc
HackerNews clone built with Nuxt.js on Cloudflare Pages
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Comments are closed.