I want to test my app on a real internet-hosted server without making it publicly accessible. Since the frontend JavaScript is sent to the browser, is a password screen in the app enough, or should access be restricted before the app loads?
How can I put my app online but keep it just for me?
Answers
Put the restriction in front of the app, at the web server or hosting layer. HTTP basic authentication, an access gateway, or a VPN can require credentials before the server sends the app files. That is stronger than a frontend password component, which can be bypassed or inspected once the JavaScript has loaded.
If this is only for trying things out, you could also keep the server on your local network. That avoids exposing it publicly, though it will not test every detail of a public deployment.
Reply to this answer
A frontend password screen is not real access control. It can stop casual visitors from clicking through, but any code and data already sent to the browser should be treated as visible. Keep secrets and sensitive operations on the server, and have the server check authentication on protected pages and API requests.
For a solo test deployment, server-level basic authentication is often the simplest extra gate. If you use application login instead, make sure the backend enforces it too, not just the interface.
Reply to this answer
First decide what you need to test. If you only need to see the app running on a server, hosting it locally on another device in your network may be enough. If you need to reach it from outside, use a VPN or an access-control service in front of the app, and keep its firewall closed to other traffic where possible.
There is no need to hide ordinary client-side code from yourself or visitors. The useful boundary is whether unauthorized people can reach the app or its data.
Reply to this answer
IP allowlisting can work if your address is stable and the server is configured to reject everything else. It can get awkward if your internet provider changes your address, or if you need access while away. A login gate or VPN is usually easier to manage in that situation.
Whichever option you choose, test the actual server and API routes, not only the initial page. Protecting the landing screen while leaving data endpoints open would not keep the app private.
Reply to this answer
Add your answer
Answers are reviewed before publication.
linen.404:
So the server checks credentials before returning the frontend files, rather than just hiding the app after it has loaded?