Permanent link for website without change every time? - web

Hi I have made an application that once opened connects to a website connected to a vps (I use with ngrok) that hangs the localhost of xampp and uses ngrok to make it public. But many times I have to make changes and have to disconnect and restart. But this changes the ngrok site and I am forced to change it on the application as well. I am also asking for an update to all those who still have the app with the website.
How can I make a permanent link that I can keep in the app and then from the server I change the ngrok link without changing the permanent one too?
Thank you
I tried to look for something that would do this but found nothing already

Related

Heroku This site can’t be reached (DNS_PROBE_FINISHED_NXDOMAIN)

Some of my personal apps and my professional apps on Heroku are not accessible.
They don't have a custom domain linked, so I access them via http://.herokuapp.com
Most of the time, they work great, but often I receive following response from my browser
This site can’t be reached
<myapp>.herokuapp.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
The app is up and running. It does not crash (as I haven't made any changes to it in a while).
I have tried restarting all dynos, to which the log says that the app is up and running and the db is connected.
Heroku is also not reporting any of their services to being down either.
How can I resolve this issue?
I have read a similar question, but the only result coming from it was that Heroku was temporarily down. So please don't link that one again.
Update
Without any of my interference, the application can be reached again on Heroku. How is this possible if Heroku says that there were no problems with their app platforms?
And more important: is there a way to defend against this?

Getting over a 426 upgrade required

I've been working on a web app (front Angular, back Node/Express/Mongo) for a few months now.
I run Angular on localhost:4200 and Node on localhost:3000
Some people in our team are running the backend in a VM that runs on their computers.
So that the app works in both cases we've edited the windows hosts file to make the app point to the correct place (either the VM or the back on the local machine)
127.0.0.1 mysite
Developers using the VM changed 127.0.0.1 with their VM's IP.
Everything worked smoothly.
A few days ago, our company installed bitlocker on every PC and I believe it caused our setup to break for everyone not using the VM (which is not subject to bitlocker)
People working on localhost started receiving from the front app:
OPTIONS http://mysite:3000/auth/login 426 (Upgrade
Required)
The requests are not even hitting the Node server. Looks like they're redirected to a websocket server?
If I change the requests to target localhost:3000 the app works again but we lose the setup for people working on the VM. (thus committing code becomes annoying if we need to change the base url each time)
I could make an environment for each case but it's not clean and I'd like to know why it suddenly broke.
Try changing the port from 3000 to something else.
I just ran into this issue when a coworker tried running an express app we've been building on a Windows machine for the first time, as opposed to an EC2 instance. I've been using a Mac during development.
The issue seemed to be that 0.0.0.0:3000 was already mapped on company Windows machines. If you run netstat -an in a command prompt you may see it in use already.
hello mate this usually happens due to protocol mismatch between the PC and server.TLS 1.0 and 1.1 were permanently deprecated on June 4 2018. I suspect you’re using something that still uses and old version of TLS.

ReactJS: How to deploy on local server

I have a web app developed with a NodeJS + Express + GraphQL + MongoDB back-end and a ReactJS + Apollo front-end. I would like to deploy this application locally. Is that even possible?
I have come across dozens of "how to deploy to Heroku," "how to deploy to Digital Ocean", "how to deploy to Github", etc. But none that explains how to deploy locally.
Right now, I run: nodemon server for the back-end, and npm start for the front-end. I see the application running on http://localhost:3000/ (I use cors to connect the front end with the server running on port 3001).
I would like to just go to http://localhost:3000/ and see the app without having to execute the commands npm start and nodemon server. Is this possible? If so, how do I do that?
To my knowledge, our local server is not a WAMP server (our OS is Windows though). The IT department told me that it is a
[...] plain, regular old server. The address is localhost running on
port 3000. You can open up another port on 3001 if you need it. Just
drop your stuff on the C: drive and you should be good to go. I've
never heard of Node or React so I can't help if you have questions.
Any ideas? Many thanks in advance for your help!
UPDATE
There seems to be a bit of confusion surrounding what I am looking for. I am trying to deploy this locally.
Let's say, on your local computer (your laptop at home) you go to localhost:3000 on your favorite browser. Unless you are serving something to localhost in that moment nothing is going to show up, it will say "refused to connect" or something. What I want is to be able to open any machine on the network whenever I go to localhost:3000 and my react site appears and functions...does that make more sense?
I don't want this is development mode. I want a build of this project on localhost...I'm starting to think this isn't possible.
As i understood, you want to deploy it on a local server, not locally on your developing device.
I thought about doing that...but I'm not so sure IT will be okay with it always running... :(
How can you use a server if its not running? Just like WAMP (which runs apache), or whatever you got rolling there, it must be running. So, just make it a background process like slawomir suggested.
PS I dont think you understand node server properly though.
Read this to understand why node server needs reloading. After that you need to understand that no hot reload tool is perfect, and you gonna need to restart your server from time to time.
PPS I dont know what this means
[...] plain, regular old server. The address is localhost running on port 3000.
if there is a server running on 3000, youll need to change port for your server to smth else (most common is 9000)
To solve the problem you can create a startup script, which executes npm start and nodemon server. Then make sure to keep it hidden, so that your server will be always running. Keep in mind though, that any errors thrown will stop your server and unless you configure it, the server won't reload by itself.
I would try following:
build your app with the production environment variables set
get all files from dist folder and deploy them in your server
now access your app using localhost/
Maybe what you are looking for is something like ngrok which creates a socks tunnel to your localhost, effectivelly deploying from localhost, as I understand it, allowing you to access your localhost through a url like ldiuhv093.ngrok.io, or even a custom subdomain if you pay for a subscription fee.
If I have this wrong, someone please tell me!
To solve the problem first of need to create a batch file with .bat or .cmd extension and under that file add the following 2 command
nodemon server
npm start
Then follows the following steps to add it as a startup script for windows OS.
Create a shortcut to the batch file.
Once the shortcut has been created, right-click the file and select
Cut.
Press the Start button and type Run and press enter.
In the Run window, type shell:startup to open the Startup folder.
Once the Startup folder has been opened, click the Home tab at the
top of the folder and select Paste to paste the shortcut into the
folder.
Above steps are for example to create a batch file and add it as a startup script for Windows 8 and 10 users.
For better clarity or reference follows the following link.reference-link
There's no option to reload the server while keeping it running. You could, technically, have your 'main' file monitor another file for changes. This would be the file where you actually keep your sever program. Then, on changes, you discard your current logic and start executing that. That said, doing it that way would be very fragile and a very round-about way to do it. It also wouldn't fix your front-end for which you'd need a similar solution.
Instead, you could hook into your favorite editor's save event, and run those two console commands, so that every time you save, the server is automatically brought up. (Make sure to also clean up existing servers)
Run on Save for VSCode
save-commands for Atom
I know this post has been two years. But, I think the solution to your second desired outcome is to use concurrency. https://www.npmjs.com/package/concurrently.
This will allow you to do one NPM START to start two all three processes.
and to your first question, I think the solution is to add Electron to your app so you can package it to an executable application. When you start the app, your express server will start running in the background.
Most people probably don't understand why there is a need for this. Running on local server (computer) allows access to local file system and can even run SQL queries inside the proxy which would require IT involvement if hosted on outside server.
From what I have understand, that you want to deploy your app on local server that means you want to deploy it on the network that you are connected to.
Check ip from the command prompt
To deploy it locally,
Run: HOST=ip npm run start
It will get deploy on your local server. And everyone connected to the server can access the url
If this worked for you, kindly upvote
You need to do npm start There may be other ways of starting it but, all will result in the same. You can read this article on Freecodecamp on deploying on DigitalOcean. You can manipulate it to your localhost. Shouldn't be too different.FCC Tut on Deploying

cPanel changes are not reflecting

I am trying to revamp a website. The host uses cPanel as control panel.
I changed something in index.htm file but still the old version of website gets loaded.
Just to check, I created another html file index1.htm. When I pinged the <domain-name>/index1.htm, I got the right page loaded.
What possibly is going wrong here? Is there caching happening, if yes, how can i remove it.
Yes, May be Memcached modules in installed on your server and due to that your are getting this issues, If you want to clear that cache, You will have to access your server through SSH and try with following command.
telnet localhost 11211
flush_all
quit

IIS7 change an application's virtual path to be at domain root

Under sites in IIS I have made a new node that binds to port 80 and stopped all the other websites nodes/pools that would otherwise bind to that port.
Under the new node I created an application baz1, so the path the website is on is http://MyServer/baz1/...
I also have other directories/applications under the node I created like baz2, baz3, etc...
My only problem is that the application only runs correctly when it is at the root. So instead of being at http://MyServer/baz1/ it needs to be at http://MyServer/
Is there a way to keep all the applications grouped under my new node and have only one run at a time and be run at the root? I don't want to put the one I'm trying to run under default web site for multiple reasons.
I've googled, bing'd, and experimented on everything I can think of but can't find a way to change the virtual path of an application so I'm hoping someone here knows.
Thanks everyone and if my question isn't clear let me know and I'll clarify it asap

Resources