TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Single source file react apps

1 pointsby sandruso9 months ago

1 comment

sandruso9 months ago
Hello HN,<p>during past few days I was exploring concept of single source file applications where you can hide the build system.<p>I&#x27;ve cobbled together snaptail which hides nextjs build system and allows to work with just a single file.<p>It works great for fast prototyping or building an internal&#x2F;local apps.<p>There is also support for API routes that can be exported via api variable.<p>An example:<p><pre><code> &#x2F;&#x2F; myapp.tsx export const App = () =&gt; &lt;div&gt;Hello world!&lt;&#x2F;div&gt; export const api = [ { method: &quot;GET&quot;, path: &quot;&#x2F;api&#x2F;hello&quot;, handler: async (req, reply) =&gt; { return reply.send({ hello: &quot;world&quot; }); } } ]; &#x2F;&#x2F; shell: npx snaptail myapp.tsx</code></pre>