Skip to content

PlanetHoster/nuxt-demo

Repository files navigation

Nuxt 3 Minimal Starter with N0C Deploy Script 🚀

N0C

Nuxt 3

Welcome to the Nuxt 3 Minimal Starter! This guide will help you deploy your Nuxt.js application on N0C hosting effortlessly. Follow along for a seamless deployment experience.

For more information on Nuxt 3, check out the Nuxt 3 documentation.

Demo: https://nuxt.n0c.xyz

Requirements

  • Node.js >= 18.0.0.
  • NPM

Setup

  1. Clone the Repository

    Clone this repository to your local machine. Learn more

  2. Install Dependencies

    Install the required dependencies using NPM:

      npm install
  3. Configure SSH Connection

    Set up an SSH connection to your N0C hosting. Learn how

    img.png

  4. Set Up Node.js Application on N0C

    Create and configure your Node.js application on N0C hosting. Learn more

    img.png

    Important: During the application creation step, specify the following JavaScript entry file: server/server.js

    img.png

  5. Configure Environment Variables

    Copy and rename the .env-sample file to .env. Enter the required variable values.

    USERNAME=myusername
    IP=XXX.XX.XXX.XXX
    PORT=5022
    APPLICATION_NAME="ph-nuxt"
    DIRECTORY_PATH="/home/myusername/ph-nuxt"
    STARTUP_FILE="server/server.js"
    NODE_VERSION=20
  6. Deploy Your Application

    Run the deploy command:

    npm run deploy

About the Deploy Script

  • Runs the build command
  • Sets environment variables
  • Restarts the application

The web server Passenger on N0C does not support .mjsfiles. The deploy script creates a server.js file in the server directory that imports the index.mjs to bypass this limitation. It also removes the package.json file from the server directory.

Video Demonstration

In this demo, I explain how to manually deploy a Nuxt.js application on N0C without using the deployment script.

Watch the video

Enjoy deploying your Nuxt.js application with ease!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published