A Hono 4 CRUD API starter for Node.js 22 in plain JavaScript, served by @hono/node-server, that stores one resource, items, in PostgreSQL through postgres.js. It is for developers who want a tested create, read, update and delete service to rename, with input validation, limit and offset paging, JSON errors and a /health check that queries the database.
by Light CloudCRUD APIs
src/app.js builds a Hono app around a postgres.js client and never listens, so the tests call app.request() with no server or port. Only src/server.js is Node.js specific: it creates the items table, starts @hono/node-server and, on SIGTERM, lets requests finish before closing the database client. The client is capped at 5 connections with a 5 second connect timeout in src/db.js, next to the CREATE TABLE you would change first when renaming items. On Light Cloud the deploy runs npm start with DATABASE_URL set, and every push to your copy redeploys.
This starter uses postgres.js: src/db.js builds the client from DATABASE_URL and the routes run queries as sql tagged templates. Locally, start postgres:16 in Docker and export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres before npm run dev.
Add a routes file in src/routes/ modelled on items.js, a check in src/lib/validation.js and its CREATE TABLE in src/db.js, then mount it in src/app.js with app.route('/things', thingsRoutes(sql)).
The routes in src/app.js use only Hono, so they port as they are. You replace src/server.js, which uses @hono/node-server, and check that the runtime supports postgres.js TCP connections or swap in a driver that it does.
Press Deploy on this template: Light Cloud copies the repo into your GitHub account, creates a PostgreSQL database and sets DATABASE_URL on the app. Databases need a paid plan.
Yes. It has no Light Cloud code: any host with Node.js 22 and a reachable PostgreSQL runs it with npm install --omit=dev and npm start, given DATABASE_URL and PORT.
Start a Web Standards API with Hono on Node.js, with JSON errors and tests and no build
Start an Express CRUD API on PostgreSQL with validation, paging and tests set up

Start a typed NestJS CRUD API on PostgreSQL with DTO validation and Swagger docs