I am looking to migrate existing nginx setup to Digitalocean App Platform. What i have now is www.example.com/en/index.html and www.example.com/de/index.html serving english and de version respectively. What is the best way to achieve this in app platform?
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!
In your follow up comment I see you’re using Angular. Using the Angular Router an app can create routes on the client side directly to the en and de variants. For example, you could detect the language set in the users browser then direct them to the appropriate site with this router module. This is probably the best solution.
Alternatively, you could create an app with two static site components that point to the same git repository. These sites will be the en and de versions. You will need to update the HTTP Route and the Output Directory for both versions. When accessing example.com/en it will go to the index.html in dist/en and when accessing example.com/de it will go to the index.html in dist/de.
You could also the root route (/) to one of these so that example.com will show the en or de version based on your preference.
Hello @crashoverride I cant make a frontend router route to different language because those are 2 separate apps. /en/ and /de/ i guess i could somehow make it work to route from one app to another? but im not sure how atm heh
That leaves me with option two. Only problem is how do i prevent App Platform for compiling my code twice? because i use prerendering my compile time is 18 minutes.
I have already created a small script that copies /en/ folder content to /dist/browser. Now i have /dist/browser for english and /dist/browser/de/ for de.
Will try it out tomorrow and let you know.
To further clarify we are using angular 11 which compiles two instances of same application /dist/en and /dist/de
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.