Skip to content

rphlmr/remix-hono-vite

Repository files navigation

There is now React Router Hono Server 🔥

https://github.com/rphlmr/react-router-hono-server


Welcome to Remix + Vite + Hono!

This is a demo of remix-hono with Vite.

It uses Hono Vite dev server with HTTPS

📖 See the Remix docs and the Remix Vite docs for details on supported features.

CleanShot 2024-02-22 at 12 33 10

Try it

npx create-remix@latest --template rphlmr/remix-hono-vite

How it works

  • On the local dev, you rely on Hono Vite dev server
    • With HTTPS self signed certificate
  • When building, server/build.ts bundles server/index.ts and server/middlewares.ts to build/server/index.js
    • If you deploy with Docker, it should be as easy as just copying the build folder and node_modules.

Development

Copy .env.example to .env and fill the variables. (it is loaded by Remix for you, see this PR)

Run the Hono server with Hono Vite dev server:

npm run dev

Deployment

First, build your app for production:

npm run build

Then run the app in production mode:

npm start

Now you'll need to pick a host to deploy it to. (works great on https://fly.io)

DIY

If you're familiar with deploying Hono applications you should be right at home. Just make sure to deploy the output of npm run build

  • build/server
  • build/client