Adding Nuxt to an existing Express service

Well, usually you do completely the opposite. But maybe there is another developer that is looking for this tutorial, as I was.

Why?

Before moving further, I would like to explain why I needed it. If you already have your own reasons then just skip this part.

How?

Let’s start by creating our app. Open terminal and choose a folder to work in.

mkdir nuxt-as-express-middleware; cd nuxt-as-express-middleware
npm init
npm i express nuxt
touch app.js

TL;DR

I want to mention that I’m not a Nuxt developer and not professional in it. I used documentation and debug tools for exploring how things work under the hood, so please feel free to correct me if I’m anywhere wrong.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store