<?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: Andrius Putna</title>
    <description>The latest articles on DEV Community by Andrius Putna (@fordnox).</description>
    <link>https://dev.to/fordnox</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F282192%2F38c196f7-8143-4599-8ced-afc20a4cd231.jpeg</url>
      <title>DEV Community: Andrius Putna</title>
      <link>https://dev.to/fordnox</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fordnox"/>
    <language>en</language>
    <item>
      <title>A static site that collects form submissions, in one HTML attribute</title>
      <dc:creator>Andrius Putna</dc:creator>
      <pubDate>Thu, 13 Aug 2026 12:50:05 +0000</pubDate>
      <link>https://dev.to/harvis/a-static-site-that-collects-form-submissions-in-one-html-attribute-2cln</link>
      <guid>https://dev.to/harvis/a-static-site-that-collects-form-submissions-in-one-html-attribute-2cln</guid>
      <description>&lt;p&gt;A static site has no backend. That is the point of one — and it is also why the contact form is the first thing that breaks. The usual answers are a third-party form service with its own signup, a serverless function you now maintain, or a &lt;code&gt;mailto:&lt;/code&gt; link nobody clicks.&lt;/p&gt;

&lt;p&gt;There is a third option that falls out of how static hosting already works: the host is in the path of every HTML response it serves. It can collect the form itself.&lt;/p&gt;

&lt;p&gt;On &lt;a href="https://harvis.dev" rel="noopener noreferrer"&gt;harvis.dev&lt;/a&gt; that is one attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;harvis-form=&lt;/span&gt;&lt;span class="s"&gt;"contact"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;textarea&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"message"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;Send&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy, and submissions show up in the dashboard. No script tag, no API key in the page, no &lt;code&gt;fetch()&lt;/code&gt;, no JavaScript at all — the form works with JS disabled, because it is a plain HTML form doing what plain HTML forms have always done.&lt;/p&gt;

&lt;p&gt;The page I am describing is live at &lt;strong&gt;&lt;a href="https://harvis-forms-example.harvis.dev/" rel="noopener noreferrer"&gt;harvis-forms-example.harvis.dev&lt;/a&gt;&lt;/strong&gt; — submit the form and see where you land. Everything below is what makes that page work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually happens
&lt;/h2&gt;

&lt;p&gt;The rewrite happens on the way out, while the HTML is being served:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;action&lt;/code&gt; and &lt;code&gt;method&lt;/code&gt; are replaced with &lt;code&gt;/__harvis/form/contact&lt;/code&gt; on your site's own subdomain.
Same origin, so there is no CORS, no preflight, and nothing in the page has to know a project id.&lt;/li&gt;
&lt;li&gt;A honeypot field is inserted. It is positioned off-screen rather than &lt;code&gt;display: none&lt;/code&gt;, because a
bot that skips hidden inputs is a bot that would otherwise get through. Anything that fills it in gets the success page and is stored nowhere — a bot that can tell it was caught is a bot that tries again differently.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-harvis-redirect="/thanks.html"&lt;/code&gt; becomes a hidden field, since the handler never sees your
HTML — only what the browser posts. It is re-validated on arrival, and a protocol-relative &lt;code&gt;//somewhere-else&lt;/code&gt; is refused.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reply is a &lt;strong&gt;303&lt;/strong&gt;, so the browser follows it with a &lt;code&gt;GET&lt;/code&gt; and a refresh on the thank-you page cannot post the form twice.&lt;/p&gt;

&lt;p&gt;The form name is part of a URL and a dashboard heading, so it has to match &lt;code&gt;[a-z0-9][a-z0-9_-]{0,39}&lt;/code&gt;. Anything else — including a bare &lt;code&gt;harvis-form&lt;/code&gt; with no value — collects under &lt;code&gt;default&lt;/code&gt;. Two forms on one page, two named inboxes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;harvis-form=&lt;/span&gt;&lt;span class="s"&gt;"contact"&lt;/span&gt; &lt;span class="na"&gt;data-harvis-redirect=&lt;/span&gt;&lt;span class="s"&gt;"/thanks.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;…&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;harvis-form=&lt;/span&gt;&lt;span class="s"&gt;"newsletter"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;…&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second one has no redirect, so it lands on a branded thank-you page the host serves.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one case where the attribute does nothing
&lt;/h2&gt;

&lt;p&gt;The rewrite runs over the response body, so it only sees markup that is already in the file. A form that React, Vue or Svelte mounts at runtime has no &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; in the served HTML — the marker never matches and nothing is rewritten. Write the endpoint yourself instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/__harvis/form/contact"&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"post"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"hidden"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"_harvis_redirect"&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/thanks"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* …your fields… */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The receiving side does not care who wrote those fields. Drop the &lt;code&gt;harvis-form&lt;/code&gt; attribute when you do this, or a prerendered page gets rewritten twice and ends up with two honeypots.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The page: &lt;strong&gt;&lt;a href="https://harvis-forms-example.harvis.dev/" rel="noopener noreferrer"&gt;https://harvis-forms-example.harvis.dev/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The complete source — two forms, the deploy script, the workflow — is here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/harvis-io/solutions/tree/main/forms-example" rel="noopener noreferrer"&gt;https://github.com/harvis-io/solutions/tree/main/forms-example&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Three files of site, no build step, no dependencies. Clone it, run &lt;code&gt;HARVIS_API_KEY=hvs_… ./deploy.sh public&lt;/code&gt;, and you have a static page with a working contact form about two seconds later.&lt;/p&gt;

&lt;p&gt;Here is the served HTML of that live page, which is the shortest version of this whole post:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- what is in the repo --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;harvis-form=&lt;/span&gt;&lt;span class="s"&gt;"contact"&lt;/span&gt; &lt;span class="na"&gt;data-harvis-redirect=&lt;/span&gt;&lt;span class="s"&gt;"/thanks.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- what the browser receives --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;harvis-form=&lt;/span&gt;&lt;span class="s"&gt;"contact"&lt;/span&gt; &lt;span class="na"&gt;data-harvis-redirect=&lt;/span&gt;&lt;span class="s"&gt;"/thanks.html"&lt;/span&gt;
      &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;"/__harvis/form/contact"&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;"post"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>showdev</category>
      <category>html</category>
      <category>github</category>
    </item>
    <item>
      <title>npx hosting — deploy any folder to a live URL in one command, no account</title>
      <dc:creator>Andrius Putna</dc:creator>
      <pubDate>Sun, 02 Aug 2026 15:31:54 +0000</pubDate>
      <link>https://dev.to/fordnox/npx-hosting-deploy-any-folder-to-a-live-url-in-one-command-no-account-3h65</link>
      <guid>https://dev.to/fordnox/npx-hosting-deploy-any-folder-to-a-live-url-in-one-command-no-account-3h65</guid>
      <description>&lt;p&gt;I built a zero-config CLI that deploys the current folder to a live site. Anonymous by default, with a single-use claim link if you want to keep it.&lt;/p&gt;

&lt;p&gt;Every static hosting tool I've used asks for the same ritual before you can see your site online: create an account, verify an email, install a CLI, log in, answer a config wizard. That's a lot of ceremony for "put these files on a URL".&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://www.npmjs.com/package/hosting" rel="noopener noreferrer"&gt;&lt;code&gt;hosting&lt;/code&gt;&lt;/a&gt; — a CLI where the &lt;em&gt;entire&lt;/em&gt; flow is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx hosting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. No account, no config, no login. Your folder is live:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Uploading 3 files (12.4 KB)...

  Live site:   https://1freehosting.com/s/happy-panda-482
  Claim link:  https://1freehosting.com/claim/xxxxxxxx-...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The claim-link model
&lt;/h2&gt;

&lt;p&gt;The interesting part isn't the upload — it's the ownership model.&lt;/p&gt;

&lt;p&gt;Deploys are &lt;strong&gt;anonymous by default&lt;/strong&gt;. You get two links back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live site&lt;/strong&gt; — the public URL, share it with anyone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claim link&lt;/strong&gt; — private and single-use. Open it, sign in, and the site attaches to your account so you can manage it from a dashboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unclaimed sites expire 24 hours after the last deploy. That keeps throwaway experiments truly throwaway — no zombie sites, no cleanup — while anything you actually care about is one click from permanent.&lt;/p&gt;

&lt;p&gt;This inverts the usual order: instead of &lt;em&gt;authenticate, then deploy&lt;/em&gt;, you &lt;em&gt;deploy, then decide if it was worth authenticating for&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating the same site
&lt;/h2&gt;

&lt;p&gt;The first deploy writes a &lt;code&gt;.hosting.json&lt;/code&gt; file with the site's deploy token. Every later &lt;code&gt;hosting&lt;/code&gt; run from that folder updates the &lt;strong&gt;same&lt;/strong&gt; site — before and after you claim it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim index.html
hosting        &lt;span class="c"&gt;# same URL, new content&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some details I sweated:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.hosting.json&lt;/code&gt; is added to your &lt;code&gt;.gitignore&lt;/code&gt; automatically (it contains the token).&lt;/li&gt;
&lt;li&gt;Hidden files (&lt;code&gt;.env&lt;/code&gt;, &lt;code&gt;.git&lt;/code&gt;, …) are skipped &lt;strong&gt;client-side&lt;/strong&gt;, so secrets never leave your machine. &lt;code&gt;node_modules&lt;/code&gt; and OS junk are skipped too.&lt;/li&gt;
&lt;li&gt;Want a fresh URL? &lt;code&gt;hosting --new&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Deploying from CI or another machine? Grab the token from the dashboard and run &lt;code&gt;hosting link &amp;lt;subdomain&amp;gt; --token &amp;lt;token&amp;gt;&lt;/code&gt; (or set &lt;code&gt;HOSTING_DEPLOY_TOKEN&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hosting&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deploy the current folder (updates the linked site, or creates one)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hosting deploy [dir]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deploy a specific folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hosting link &amp;lt;subdomain&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Link the folder to an existing site&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hosting claim&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open the last deploy's claim link in your browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hosting open&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open the last deploy's live site&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Fit for AI coding agents
&lt;/h2&gt;

&lt;p&gt;It's also a nice fit for AI coding agents: an agent that just generated a landing page can run one non-interactive command and hand you a live URL — no browser login dance mid-session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;your-static-site
npx hosting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CLI is MIT-licensed and open source — it's the companion to &lt;a href="https://1freehosting.com/downloads/command-line" rel="noopener noreferrer"&gt;1freehosting.com&lt;/a&gt;, where claimed sites live.&lt;/p&gt;

&lt;p&gt;I'd love feedback on the claim-link flow — does "anonymous first, claim later" feel right to you, or would you rather log in up front? 👇&lt;/p&gt;

&lt;p&gt;Also thinking to create Github action for temporary or permanent artifacts preview deployments.&lt;/p&gt;

</description>
      <category>hosting</category>
      <category>free</category>
      <category>cli</category>
      <category>static</category>
    </item>
  </channel>
</rss>
