一覧へ戻る
michaelshimeles/hono-starter-kit(新しいタブで開きます)
主要言語: TypeScript
Hono + Cloudflare Workers, Neon Postgres, & Drizzle ORM
- star 数
- 97
- watcher 数
- 2
- fork 数
- 20
- issue 数
- 0
- 最終更新
- 2024/12/10
主要言語: TypeScript
Hono + Cloudflare Workers, Neon Postgres, & Drizzle ORM
A modern, high-performance backend starter template built with Hono, featuring PostgreSQL integration with Drizzle ORM and deployment ready for Cloudflare Workers.
git clone https://github.com/michaelshimeles/hono-backend-sync
cd hono-backendbun install
.dev.vars.example to .dev.varsDATABASE_URL=your_postgresql_connection_string
npx drizzle-kit generate npx drizzle-kit push
bun run dev
The server will start on http://localhost:8787
hono-backend/
├── src/
│ ├── index.ts # Main application entry
│ └── db/
│ └── schema.ts # Database schema definitions
├── drizzle/ # Database migrations
├── .dev.vars.example # Example environment variables
├── drizzle.config.ts # Drizzle ORM configuration
├── migrate.ts # Migration script
├── wrangler.toml # Cloudflare Workers configuration
└── package.json
bun run dev - Start development server with Wranglerbun run deploy - Deploy to Cloudflare Workersnpx drizzle-kit generate - Generate database migrationsnpx drizzle-kit push - Create table(s)The starter includes a sample products table with the following schema:
products { id: serial (primary key) name: text description: text price: double precision }
GET / - Fetch all products from the databaseAll endpoints use Zod for request validation.
This template is configured for deployment to Cloudflare Workers:
bun run deploy
Make sure to set up your environment variables in your Cloudflare Workers dashboard.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.