Let's update the VUE app's development server to point to my-testing-web-address.com instead of the default localhost:

I am working on a VUE application and I am trying to run it on an external link instead of localhost.

I attempted to configure a

vue.config.js

devServer: {
    host: 'http://my-testing-web-address.com',
    port: 8080,
    ...
}

and adjusted the devserver settings, but unfortunately, there were no changes reflected.

When I execute

npm run serve

It displays the following message:

App running at:
- Local:   http://localhost:8080/ 
- Network: http://192.168.0.100:8080

Is there a way to properly configure an external devserver for this VUE application?

Answer №1

{
  module.exports = {
    devServer: {
      host: 'projectname.local'
    }
  }
}

For further information, visit this link:

Answer №2

To configure the host check in vue.config.js:

module.exports = {
  devServer: {
    disableHostCheck: true
  }   
}

Answer №3

I found that by including a comparable entry in the module.exports section of my "vue.config.js" file, I was able to resolve the issue:

devServer: {
  allowedHosts: ['(...).tunnelmole.com']
}

Answer №4

It is important to avoid using the ending ".com" in a sample url. Instead, I suggest using your-domain.test with the conclusion of ".test"

Take a look at the correct setup below:

within vue.config.js

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
devServer: {
host: 'vue-custom-domain.test',
client: {
  webSocketURL: 'ws://vue-custom-domain.test:8080/ws',
},
  }
})

For further information visit:

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

Encountering a problem when verifying if the data is in JSON format using JavaScript

I'm using JavaScript to determine whether an input value is in JSON format, but I've encountered a problem with a specific value. Below is my code explanation. isJSON = async(str) => { try { return (JSON.parse(str) && !!str); ...

The issue of object being undefined during attribute binding in Vue Lifecycle

I'm encountering an issue with the vue lifecycle - while the global objects are defined and data is retrieved in the DOM using {{ family.plusOne }}. However, when used as an attribute like :checked="family.plusOne", expecting a true value, it turns o ...

Search through an array of objects and assign a new value

I am facing a challenge with an array of objects structured as shown below: [ { "e_id": "1", "total": 0 }, { "e_id": "3", "total": 0 } ] My objecti ...

Designing a query feature to explore a Sequel Database utilizing a 'RETRIEVE' approach

In my index.erb, I've created a search bar with the following code: <nav> <div class="nav-wrapper"> <form> <div class="input-field"> <input id="search" type="search" placeholder="Search..." required> ...

Vue Storefront consistently displays errors when attempting to showcase products

Currently, I am utilizing Vue Storefront with Shopify Integration and encountering persistent errors in both the command line and browser. Every time I attempt to click on a product or category, I encounter broken links. **An error occurred - Please go bac ...

Difficulty in accurately retrieving the value in a PHP echo statement using jQuery

$id = "123"; When on the page book.php, $id is passed to an external jquery-book.php file. <script type="text/javascript"> var id = '<?php echo $id; ?>'; </script> <script type="text/javascript" src="jquery-book.php"& ...

What is the best method for activating a function with @click within an infowindow on Google Maps in Vue.js?

Here's the current code snippet: addpolygon: function(e) { var vm = this; var point = { lat: parseFloat(e.latLng.lat()), lng: parseFloat(e.latLng.lng()) }; vm.coord.push(point); vm.replot(); vm.mark ...

Merge arrays to form nested structures

Here's a mind-bending scenario for you. Imagine I have two arrays - one containing categories and the other containing arrays that follow the structure of those categories. For example: var categoryArray = ["Name", "Title", "Hire Date"]; var infoArr ...

Error message encountered when submitting a form after receiving an AJAX response: VerifyCsrfToken Exception

I'm encountering an issue with my AJAX functionality that involves rendering a form with multiple input fields and a submit button. Here is the AJAX call: <script type="text/javascript"> $('#call_filter').click(function() { $.aja ...

What could be the reason why my JavaScript code for adding a class to hide an image is not functioning properly?

My HTML code looks like this: <div class="container-fluid instructions"> <img src="chick2.png"> <img class="img1" src="dice6.png"> <img class="img2" src="dice6.png" ...

Utilizing jQuery in Wordpress to Toggle Content Visibility

Currently, my website pulls the 12 most recent posts from a specific category and displays them as links with the post thumbnail image as the link image. To see an example in action, visit What I am aiming to achieve is to enhance the functionality of my ...

Performing a cross-domain JSON Get request with JQuery

Struggling with a simple JSON get request to an API on a domain that I don't have control over. Here's the code I'm using: $(document).ready(function () { $.ajax({ type: 'GET', url: 'http://pu ...

Display a loading screen while retrieving information in React Redux

I have two sections on the page - a collection of IDs on the left side and data display on the right. When the page loads for the first time, all data related to every ID is shown. However, users can only select one ID at a time to view its specific data. ...

How can I adjust the border width of outlined buttons in material-ui?

Currently, I am in the process of modifying a user interface that utilizes Material-UI components. The task at hand involves increasing the thickness of the borders on certain outlined buttons. Is there a method through component props, themes, or styles t ...

Positioning the comments box on Facebook platform allows users to

Need assistance, I recently integrated the Facebook comments box into my Arabic website, but I am facing an issue where the position of the box keeps moving to the left. Here is an example of my website: Could someone please suggest a solution to fix the ...

Are you experiencing issues with your Ajax request?

I've been struggling to retrieve json data from an API. Despite my efforts, the GET request seems to be executing successfully and returning the correct data when I check the Net tab in Firebug. Can anyone offer advice on what could be going wrong or ...

Prevent certain dates from being selected in a designated input field

I am facing an issue with disabling certain array dates for a specific input field in a datepicker calendar. Even though I have included the script to exclude those dates, they are not getting disabled for that particular input field. html <input cla ...

A simple guide on passing a variable from Node.js to the view

Currently, I am delving into the world of Node.js and encountering a hurdle in sending a variable from app.js to index.html without relying on Jade or any other template engine. Below is my implementation in app.js: var express = require("express"); var ...

Tips for Interacting with an API using curl -X Command in Vue

My dilemma is that I have stored wishlist items in a cookie, but when using an incognito tab, the cookie isn't available and the data can't be fetched. I've found a solution in the form of this extension that provides 3 endpoints: https:// ...

How to utilize FileReader for parsing a JSON document?

I'm currently facing an issue while attempting to read and copy a JSON file uploaded by the user into an array. When using .readAsText(), the returned data includes string formatting elements like \" and \n. Is there a way to utilize FileRe ...