Question

How can I point a Droplet to a subdirectory?

I recently purchased a Digital Ocean Droplet and need to connect it to a domain. I have a landing page available at example.com, but I want my frontend to send requests to the server that go to routes like example.com/api/something.

When I try and connect my domain to my Droplet it gives some DNS records to add, but it says my hostname is example.com. This isn’t going to make it so that my existing frontend can’t be accessed at example.com, right? Also, my backend is built in express/node.js, so does doing something like router.get(“/api/something”); automatically create that subdirectory, or do I have to explicitly create it?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
September 16, 2022

Hi @developersray,

Depending on what you are using - Apache/Nginx and additionally, Django, Laravel, etc. you’ll need to configure that there.

What I’ll recommend is to either post what you plan to use here or give it a bit more research on the web on how to setup it.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up