Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Single source file react apps (snaptail.dev)
1 point by sandruso on Aug 25, 2024 | hide | past | favorite | 1 comment


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: