Early alpha. Not production-ready, and APIs can change. Read the status

LongHorn

Getting started

To start with LongHorn, run npm create longhorn@latest to generate a project. The new project has its own copy of the framework, plus tests and guides.

LongHorn is an early alpha. It has not been deployed to production, and its APIs can still change.

What you need

Create a project

npm create longhorn@latest my-api -- --runtime node
cd my-api
pnpm install
pnpm dev
curl http://127.0.0.1:3000/health
# {"status":"ok","runtime":"node","ready":true}

The smallest app

app.http is a real Hono app, so Hono routers and middleware work directly.

import { Longhorn } from '@longhornjs/core'
import { nodeRuntime } from '@longhornjs/node'

const app = new Longhorn()

app.http.get('/hello/:name', (c) =>
  c.json({ message: `Hello, ${c.req.param('name')}` }))

const server = await app.listen(nodeRuntime, { port: 3000 })
console.log(server.url)

Choose a starting template

You are buildingCreate it with
An HTTP APInpm create longhorn@latest my-api -- --runtime node, or bun, deno, workers
An app with a databasepnpm create:app ../my-app --runtime node --template sqlite-tasks, or bun, deno
An app with accountspnpm create:app ../my-app --runtime node --template sqlite-auth, or bun, deno
A Worker with storagepnpm create:app ../my-app --runtime workers --template d1-tasks
The complete consolepnpm create:app ../my-app --runtime node --template command-app, which needs PostgreSQL

Templates don't work from the npm 0.1.0 packages yet, so pnpm create:app runs from a clone of the repository, after pnpm install.

Next: run it on another host, or read the starter guide.