<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 임세환</title>
    <description>The latest articles on DEV Community by 임세환 (@_e0f9817451dff6c8a087e).</description>
    <link>https://dev.to/_e0f9817451dff6c8a087e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3707969%2Fa11200f9-eee3-42d5-8cc2-948defbf5c53.png</url>
      <title>DEV Community: 임세환</title>
      <link>https://dev.to/_e0f9817451dff6c8a087e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_e0f9817451dff6c8a087e"/>
    <language>en</language>
    <item>
      <title>Building a 49-Country Exchange Calculator with a Single Static Page</title>
      <dc:creator>임세환</dc:creator>
      <pubDate>Tue, 13 Jan 2026 03:42:16 +0000</pubDate>
      <link>https://dev.to/_e0f9817451dff6c8a087e/building-a-49-country-exchange-calculator-with-a-single-static-page-2eap</link>
      <guid>https://dev.to/_e0f9817451dff6c8a087e/building-a-49-country-exchange-calculator-with-a-single-static-page-2eap</guid>
      <description>&lt;p&gt;When I started building a travel exchange calculator, I ran into a familiar problem.&lt;/p&gt;

&lt;p&gt;People don't search for "exchange calculator."&lt;br&gt;&lt;br&gt;
They search for &lt;em&gt;"Vietnam currency to KRW"&lt;/em&gt;, &lt;em&gt;"Japan yen to won"&lt;/em&gt;, &lt;em&gt;"Thailand baht rate"&lt;/em&gt;, and so on.&lt;/p&gt;

&lt;p&gt;Each country has its own search intent, but building a separate HTML page for every country quickly turns into a maintenance nightmare.&lt;/p&gt;

&lt;p&gt;So I asked myself a simple question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can one static page behave like dozens of localized landing pages?&lt;/strong&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  The Idea: Let the URL Do the Work
&lt;/h2&gt;

&lt;p&gt;Instead of creating 49 different HTML files, I used the URL path as a preset key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/travel/exchange-calculator/vietnam/
/travel/exchange-calculator/japan/
/travel/exchange-calculator/thailand/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last segment of the URL is read by JavaScript, matched against a preset table, and used to automatically initialize the calculator with the right currencies.&lt;/p&gt;

&lt;p&gt;Same HTML.&lt;br&gt;&lt;br&gt;
Same JavaScript.&lt;br&gt;&lt;br&gt;
Different user experience depending on the URL.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why This Works So Well
&lt;/h2&gt;

&lt;p&gt;This pattern has a few big advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No build system&lt;/strong&gt; — just plain files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No duplicated HTML&lt;/strong&gt; — one source of truth&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One codebase to maintain&lt;/strong&gt; — fix once, deploy everywhere&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO-friendly URLs&lt;/strong&gt; — every country gets its own indexable path&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From the user's point of view, it feels like a country-specific calculator.&lt;br&gt;&lt;br&gt;
From the developer's point of view, it's still just one static page.&lt;/p&gt;


&lt;h2&gt;
  
  
  How the Routing Works
&lt;/h2&gt;

&lt;p&gt;At page load, the script extracts the last segment from &lt;code&gt;location.pathname&lt;/code&gt; and checks it against a simple preset map:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;presets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;vietnam&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;VND&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;KRW&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;japan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;JPY&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;KRW&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;thailand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;THB&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;KRW&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;usa&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;KRW&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="c1"&gt;// ... 45 more countries&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;segment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;presets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;segment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;KRW&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nf"&gt;initCalculator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If there's a match, the calculator initializes with those currencies.&lt;br&gt;&lt;br&gt;
If not, it falls back to a sensible default (USD → KRW).&lt;/p&gt;

&lt;p&gt;That's it. No server logic, no framework routing, no URL rewrites.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I Built It This Way
&lt;/h2&gt;

&lt;p&gt;I'm building &lt;strong&gt;&lt;a href="https://sudanghelp.co.kr/" rel="noopener noreferrer"&gt;Sudanghelp&lt;/a&gt;&lt;/strong&gt; — a real-world finance calculator platform focused on practical tools people actually use, from government benefits and military pay to travel expenses and currency exchange.&lt;/p&gt;

&lt;p&gt;This exchange calculator is one piece of that ecosystem.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://sudanghelp.co.kr/travel/exchange-calculator/" rel="noopener noreferrer"&gt;sudanghelp.co.kr/travel/exchange-calculator/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  When This Pattern Makes Sense
&lt;/h2&gt;

&lt;p&gt;This approach works especially well when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're on a static host (GitHub Pages, Netlify, Cloudflare Pages)&lt;/li&gt;
&lt;li&gt;You want SEO-friendly URLs for many variations of the same tool&lt;/li&gt;
&lt;li&gt;You don't need a heavy framework just to handle routing&lt;/li&gt;
&lt;li&gt;Your "variations" are really just different initial states&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's basically turning your URL structure into a lightweight configuration API.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Frameworks are great, but for many real-world tools, &lt;strong&gt;plain HTML + JavaScript + smart URLs&lt;/strong&gt; go a long way.&lt;/p&gt;

&lt;p&gt;Sometimes the simplest solution is the most maintainable one.&lt;/p&gt;

&lt;p&gt;If you're building similar tools or curious about the platform behind this, check out &lt;strong&gt;&lt;a href="https://sudanghelp.co.kr/" rel="noopener noreferrer"&gt;Sudanghelp&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What patterns do you use to handle multiple landing pages without duplicating code? I'd love to hear other approaches in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
