Skip to content

Commit

Permalink
feat(api): init hono project
Browse files Browse the repository at this point in the history
  • Loading branch information
duongdev committed Jun 5, 2024
1 parent 98f3ae3 commit 53d7825
Show file tree
Hide file tree
Showing 7 changed files with 1,112 additions and 2,433 deletions.
30 changes: 30 additions & 0 deletions apps/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# dev
.vercel/
.yarn/
!.yarn/releases
.vscode/*
!.vscode/launch.json
!.vscode/*.code-snippets
.idea/workspace.xml
.idea/usage.statistics.xml
.idea/shelf

# deps
node_modules/

# env
.env
.env.production

# logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# misc
.DS_Store
.vercel
4 changes: 4 additions & 0 deletions apps/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```
npm install
npm run start
```
14 changes: 14 additions & 0 deletions apps/api/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Hono } from 'hono'
import { handle } from 'hono/vercel'

export const config = {
runtime: 'edge'
}

const app = new Hono().basePath('/api')

app.get('/', (c) => {
return c.json({ message: 'Hello Hono!' })
})

export default handle(app)
16 changes: 16 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@6pm/api",
"version": "0.0.0",
"license": "GPL-3.0",
"private": true,
"scripts": {
"start": "vercel dev",
"deploy": "vercel"
},
"dependencies": {
"hono": "^4.4.3"
},
"devDependencies": {
"vercel": "^34.2.5"
}
}
10 changes: 10 additions & 0 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"skipLibCheck": true,
"strict": true,
},
}
8 changes: 8 additions & 0 deletions apps/api/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rewrites": [
{
"source": "/api/(.*)",
"destination": "/api"
}
]
}
Loading

0 comments on commit 53d7825

Please sign in to comment.