Skip to content
Open

Add koa #1378

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions framework-boilerplates/koa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Prerequisites:

- [Vercel CLI](https://vercel.com/docs/cli) installed globally

To develop locally:

```
npm install
vc dev
```

```
open http://localhost:3000
```

To build locally:

```
npm install
vc build
```

To deploy:

```
npm install
vc deploy
```
12 changes: 12 additions & 0 deletions framework-boilerplates/koa/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "koa",
"type": "module",
"dependencies": {
"@koa/router": "15.2.0",
"koa": "3.1.1"
},
"devDependencies": {
"@types/koa": "3.0.1",
"@types/node": "24"
}
}
14 changes: 14 additions & 0 deletions framework-boilerplates/koa/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Koa from 'koa'
import { Router } from '@koa/router'

const app = new Koa()
const router = new Router()

router.get('/', (ctx) => {
ctx.body = { message: 'Hello from Koa!' }
})

app.use(router.routes())
app.use(router.allowedMethods())

app.listen(3000)