Skip to content

Show HN: Single source file react apps

snaptail.dev
1 pointsandruso1 comment
On HN

Comments

Hello HN,

during past few days I was exploring concept of single source file applications where you can hide the build system.

I've cobbled together snaptail which hides nextjs build system and allows to work with just a single file.

It works great for fast prototyping or building an internal/local apps.

There is also support for API routes that can be exported via api variable.

An example:

  // myapp.tsx
  export const App = () => <div>Hello world!</div>
  export const api = [
    {
      method: "GET", path: "/api/hello",
      handler: async (req, reply) => {
        return reply.send({ hello: "world" });
      }
    }
  ];
  // shell:
  npx snaptail myapp.tsx
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.