Switching Laravel from Localhost to a live IP address can be done by updating the configuration settings

While deploying my Laravel application on a DigitalOcean cloud server using LAMP, I encountered an issue with VueJS integration. The app successfully posts data from the database to a URL called /proapi and fetches it using Axios when running on localhost:8000. However, upon deployment to the live IP address, I received the following error:

OPTIONS http://localhost:8000/proapi/ net::ERR_CONNECTION_REFUSED

Uncaught (in promise) Error: Network Error

I initially suspected the .env file as the source of the problem and changed the APP_URL to match the live IP address. Unfortunately, this adjustment did not resolve the error. Where should I look to update the URL in order to fix this issue?

Answer №1

Head to the main directory of your program and update the specified lines within the .env document:

APP_DEBUG=true
APP_URL=http://localhost

modify it to:

APP_DEBUG=false
APP_URL=http://mywebsite.com

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

Eliminating any empty spaces and blank lines from a text file stored on the local device

ShowOwi g exsu n Sierouz nicee99 This text was extracted from an image screenshot and saved as a file named B&W1.txt. In an attempt to remove the blank spaces in the lines and append them into a list, the following JavaScript code is used: var fi ...

Performing Ajax requests in a for loop without using jQuery

I am encountering an issue with a for loop that invokes an AJAX method function clearContainerTable() { var caf = document.getElementById('CAF').value; var containerToAddTable = caf.split("#"); for (var i = 0; i < containerToAdd ...

When defining multiple types for props in Vue, the default behavior for Boolean type props is not preserved

Imagine you have a component called MyComponent with a prop named myProp declared as: props: { myProp: Boolean } By simply using <MyComponent myProp/>, the default behavior would set myProp to true. However, this simplicity is lost when there ...

Incorporating values from a PHP file into the index.php: A step-by-step guide

How can I retrieve information from a PHP file and insert it into index.php? Below are my files: image.php <?php $client_id = "xxxxxx"; $image ='https://pic.jpg'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.imgur.c ...

Mapping an array within an array and then pushing the result

I am facing a challenge with an empty array that I have: items: [ { item:null, category_id: null, } ] Can anyone help me figure out how to populate this empty array with the data? Here is an example of the data I have: ...

Ways to prevent Deno Workers from using cached source code

Good day, I am currently working on building a custom javascript code execution platform using Deno Workers. Additionally, I have implemented an Oak web server to manage requests for script modifications and their compilation and execution. An issue arise ...

The HTML changes are not reflected in the document.querySelectorAll function

Trying to select all the div elements within another div using document.querySelectorAll. Interestingly, when setting the height to 1000 in the JS, the browser's scrollbar adjusts accordingly (the balloons do not change size). What could I be doing in ...

Break down an array-like object with no duplicates

I'm currently learning about working with JavaScript arrays and have a question regarding creating new array objects by splitting an attribute of an existing object. I attempted using methods like .map and .flatMap, but the output I received consiste ...

What steps should I take to execute a js file in the Next.js server-side?

I have a snippet of code within a separate file that initializes a worker for bullmq. Since it operates independently from the main server logic in Next.js, it is never executed unless explicitly called elsewhere. For example, I have the following code in ...

Why is there a dot displaying in my countdown when the hours are zero? Also, why does my minute not show as 00 when it passes 59?

There is an issue with the minutes here. https://i.sstatic.net/M8pYB.png Also, there seems to be a problem with the hour dot: https://i.sstatic.net/55SFU.png const [time, setTime] = useState(60 * 60) const hour = time / 3600 let minutes = Math.floor(time ...

Seamless side-to-side navigation

Currently, I am working on a website that has horizontal overflow instead of the common vertical scroll. While everything seems to be functioning properly, I need to enhance the user experience by adjusting the amount scrolled to move larger sections of th ...

Error Handling with Node.js Sequelize RangeError

Currently, I am in the process of setting up a table to store user sessions. Specifically, I plan to save the IP address as an integer and have been exploring various methods for achieving this. You can find more information on this topic here: IP-addresse ...

Webpack fails to handle CSS background images

I'm having trouble with my Webpack configuration as it's not processing CSS images set in the background property: background: url('./hero.jpg') no-repeat right; This is resulting in an error message that reads: ERROR in ./src/app/comp ...

Tips for deleting all content below a specific key in a JSON object

My JSON data (located within req.body) is structured like this: {body : { Cust : {...} }, { Input : {...} }, { Reciept : {image: [Array] } } } I am trying to remove the entire Reciept key so that the updated JSON looks like this... {body : ...

Encountering a syntax error when utilizing a specific JavaScript method

I encountered an error while working on my JavaScript code. I am trying to prevent duplicate values using a method, but it is resulting in a syntax error. Let me explain the relevant part of the code below: var outputList = []; for (var i = 0; i < spec ...

The JavaScript function getSelection is malfunctioning, whereas getElementById is functioning perfectly

I am encountering a peculiar situation while trying to input text into a textbox using a JavaScript command. The CSS locator does not seem to update the text, whereas the ID locator is able to do so. URL: Below are screenshots of the browser console disp ...

Utilizing Firebase authentication and next-auth in Next.js - Authentication currently returns null

I'm creating a website with nextjs 13 (app router) and incorporating firebase. I've come across suggestions to combine next-auth and firebase auth for using firebase auth effectively. Accordingly, I have configured my firebase Here is the fireba ...

Transform Text into Numeric Value/Date or Null if Text is Invalid

Consider the TypeScript interface below: export interface Model { numberValue: number; dateValue: Date; } I have initialized instances of this interface by setting the properties to empty strings: let model1: Model = { numberValue: +'', ...

Setting the text alignment using the innerHTML property of CSS

Having difficulty aligning text with innerHTML I am trying to create a link element using JavaScript, but I cannot get the text to align to the center. Here is my code: a= document.createElement('a'); a.style.cssText= 'font-size: 20px; curs ...

Issue with Retrieving a particular table from SQL Server using mssql in javascript ('dbo.index')

I am currently experiencing an issue with trying to access a table named dbo.Index from SQL Server in my node js express application. Unfortunately, whenever I attempt to do so, the operation fails and returns no data. Below is the code snippet in questio ...