Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello DigitalOcean Commmunity!
I’m very new to app development, but the tutorials in this community have given me the confidence and the inspiration to learn a lot about what the DigitalOcean App Platform is capable of. And I’m having a lot of fun!
I need a little help understanding how I can restrict access to a directory on the DigitalOcean App Platform.
So far, I built a small app using Node.js with Express for the backend, powered by the Bootstrap framework on the frontend. Both are listed as resources for my app and are functioning well.
The problem I’m having is: I want to restrict users from accessing the /app directory if they’re not logged in. In other words, if a user who isn’t logged in tries to access https://www.example.com/app (or https://www.example.com/app/index.html), I want the user to be redirected to https://www.example.com/login.html.
Here’s an example of the file structure I’m working with right now:
| api
| |-- app.js
| app
| |-- index.html
|-- index.html
|-- login.html
The /app directory will house the majority of the app, while the root directory (with its own index.html and login.html files) will serve as the landing site/splash page for first-time users.
I’ve previously used a .htaccess file to restrict access to certain directories using Apache, but since I’m not running a VPS and I don’t need to block access to the entire directory (since logged in users should be permitted access), how can I accomplish this on the App Platform?
Apologies if this question is a bit naïve. I’m new to this and am really using it as a sandbox for the time being, but I’m hopeful I can learn a bit and press on with the design of my app to build something useful.
Thank you in advance for the help!
a6309a057c3f4cb38fb2e7feb67236
KFSys
ef1ed44cc2154be3bcbb2d727878f8
Devs Neonetworks
1e6b823ea20d4cb189a34a922f5588
Telmo Valverde
erik-jan martens
Henry Mui
anthonycarreon
garantieheld
Marin