Tips for Deploying Your NuxtJS Project on a Shared Hosting Service

After creating my NuxtJS project locally, I am now facing the challenge of deploying it to a shared hosting provider like Host Gator.

Since I intend to utilize the server side rendering feature of NuxtJS, I know I need to execute the following command:

npm run build

However, once the project is built, I am unsure about the correct procedure for deploying it to shared hosting. Any guidance on this would be greatly appreciated!

Answer №1

According to @AlexanderStaroselsky, deploying a nuxt app to shared hosting may not be successful due to the inability to run a reverse proxy after deployment. I attempted this on Godaddy shared hosting and it turned into a complete disaster.

After gaining shell access, installing node, transferring files, running npm run build, and npm start, everything seemed to be going smoothly until the issue arose of directing traffic to the nuxt app. Unlike traditional methods using .htaccess to direct to index.php or index.html, redirecting to http://localhost:3000 through a rewrite rule caused malfunctions within the app. Despite making the app visible, key functionalities such as routing didn't work, images linked with require('~/assets/images/...') wouldn't display, rendering the entire setup unworkable.

The solution lies in being able to install nginx for setting up a reverse proxy, which is not feasible on shared hosting platforms that do not provide root privileges for such installations. Cloud hosting providers offer virtual servers with full root access, allowing you to install nginx, node, and other necessary packages. Popular and affordable options include digitalocean, AWS, Google Cloud, UpCloud, among others.

Deploying a nuxt app can be complex, especially when incorporating a rest api and obtaining an SSL certificate. However, detailed documentation exists to guide you through these processes.

In the rare case that someone manages to successfully deploy a nuxt app on shared hosting, please share your method so I can make use of my neglected Godaddy account, for which I paid several years' worth but no longer utilize.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

There seems to be an issue with creating cookies in the browser using Express.js

When using res.cookie(), I encountered an issue where the cookie was created but not showing in the browser. Although the cookie was not stored, it was visible when using Postman. I attempted to set the cookie using res.cookie("access_token", token, {sec ...

What is the process for acquiring a comprehensive catalog of Node.js modules?

Currently, I am working on integrating NPM functionality into my Node.js applications. My goal is to be able to analyze the node modules available on my system. When referring to a "module" in this context, it could either be an identifier like "fd" or a f ...

Troubleshooting Angular 5: Interceptor Fails to Intercept Requests

I have a valid JWT token stored in local storage and an interceptor that I borrowed from a tutorial. However, the interceptor is not intercepting requests and adding headers as expected. Here's where I am making a request: https://github.com/Marred/ ...

The combination of PHP and JavaScript looping is struggling to produce the correct sequence of results

for(var i=0; i<participantNum; i++){ studentID = $('#txtID'+(i+1)).val(); alert(studentID); //implementing a PHP function to validate each student's ID by making AJAX calls request("http://localhost/lastOrientation/2_regis ...

CASL user update has been refreshed

My CASL implementation is quite basic and I've noticed that the documentation lacks detail. The code I'm using is essentially a copy-paste from the docs: import { abilitiesPlugin } from '@casl/vue' import defineAbilitiesFor from &apos ...

Angular 6: Harnessing the Power of Subject

In my angular applications, I have been utilizing the Subject feature from the rxjs library to create an event emitter. However, upon migrating to Angular 6, I encountered the issue that this module is no longer available. Cannot find module 'rxjs/Su ...

What is the best way to incorporate an ASYNC function within a .map function to dynamically populate a table in a REACT application?

I am attempting to use the .map() method in REACT to call an async function and populate table data cells. The async function communicates with the backend of my application using data from the array being looped through. When called correctly, the functi ...

The data retrieved from the web API is not undergoing the necessary conversion process

I am facing an issue with a web API call where the property checkNumber is defined as a double on the API side, but I need it to be treated as a string in my TypeScript model. Despite having the property defined as a string in my model, it is being receive ...

ng-model establishes a connection with objects, not properties

Having just started my journey with AngularJS and JavaScript, I decided to create a simple app that allows users to input their name and age, and then displays the list of users and their ages. Here is the code I put together: var main = angular.module( ...

JavaScript: The function is encountering issues with properly formatting the numbers

I am currently facing an issue with a function I have created to format numbers for currency by inserting commas every 4 digits. The problem lies in the fact that the first 4 numbers do not have a comma added where it should be, and the formatting only wor ...

Incorrect viewport widths in Vue Bootstrap fluid containers

I require a container that spans 100% of the available width until it reaches a specific breakpoint (max-width). Upon exploring the official documentation, I came across the responsive fluid container, which appeared to be a suitable choice. Responsive ...

After downloading the latest version of NodeJS, why am I seeing this error when trying to create a new React app using npx?

After updating to a newer version of NodeJS, I attempted to create a new React app using the command npx create-react-app my-app. However, I encountered the following error message: Try the new cross-platform PowerShell https://aka.ms/pscore6 PS E:\A ...

Total number of goals scored by a single team (extracted from JSON data)

My data consists of football games in a JSON file [ { "game_id":"258716", "game_date_start":"2016-08-15", "season": "2016", "team_1_id":"119", "team_2_id":"120", "team_1_goals_quantity":"2", "team_2_goals ...

Is it possible to change the hover highlight rotation on a link without affecting the surrounding elements?

Is it possible to rotate the highlight on a link when hovered? I'm new at this, so apologies if this question seems basic. This is how my css/html is currently structured: .links { display: block; } .links a { color: #000000; text-decoratio ...

Experiencing difficulties accessing the API route through Express

Every time I attempt to access /api/file, I am receiving a status code of 404. Here is the relevant code snippet: app.js : ... app.use("/api", require("./routes/users")); app.use("/api", require("./routes/file")); ...

How to specify a single kind of JavaScript object using Typescript

Let's say we have an object structured as follows: const obj = [ { createdAt: "2022-10-25T08:06:29.392Z", updatedAt: "2022-10-25T08:06:29.392Z"}, { createdAt: "2022-10-25T08:06:29.392Z", animal: "cat"} ] We ...

Tips for Managing Disconnection Issues in Angular 7

My goal is to display the ConnectionLost Component if the network is unavailable and the user attempts to navigate to the next page. However, if there is no network and the user does not take any action (doesn't navigate to the next page), then the c ...

When the user clicks the back button in AngularJS

After searching extensively, I have yet to find a straightforward solution to my issue. The problem lies in a search/filter field that filters the page based on user input. While this filter works efficiently, it clears whenever a navigation item is clicke ...

Change from using fs.writeFileSync to fs.writeFile

I have a question about changing fs.writeFileSync to fs.writeFile const users = { "(user id)": { "balance": 28, "lastClaim": 1612012406047, "lastWork": 1612013463181, "workersCount": 1, ...

Fetching requests always seem to remain unfinished

I previously had this code in a different question, but since they are not unrelated, I decided to move it to a new one... Here I am again with the same code, but facing a different issue. My application is set up and running on an express server with a p ...