Skip to content

Commit ab4ddf1

Browse files
committed
initial setup honojs
0 parents  commit ab4ddf1

19 files changed

Lines changed: 191 additions & 0 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Docker images
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
build-and-push-dockerfile-image:
9+
if: startsWith(github.repository, 'Inkubator-IT/template-') == false
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v2
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
22+
- name: Build and push Docker image
23+
uses: docker/build-push-action@v4
24+
with:
25+
context: .
26+
file: ./Dockerfile
27+
push: true
28+
tags: |
29+
namespace/example:latest
30+
platforms: linux/amd64

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# prod
2+
dist/
3+
lambda.zip
4+
5+
# dev
6+
.yarn/
7+
!.yarn/releases
8+
.vscode/*
9+
!.vscode/launch.json
10+
!.vscode/*.code-snippets
11+
.idea/workspace.xml
12+
.idea/usage.statistics.xml
13+
.idea/shelf
14+
15+
# deps
16+
node_modules/
17+
18+
# env
19+
.env
20+
.env.production
21+
22+
# logs
23+
logs/
24+
*.log
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
pnpm-debug.log*
29+
lerna-debug.log*
30+
31+
# misc
32+
.DS_Store

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM oven/bun:alpine AS base
2+
3+
FROM base AS deps
4+
WORKDIR /app
5+
6+
# Install dependencies
7+
COPY package.json bun.lock ./
8+
RUN bun install --frozen-lockfile
9+
10+
# Copy source code
11+
COPY . .
12+
13+
# Run the app
14+
USER hono
15+
EXPOSE 5050/tcp
16+
CMD ["bun", "src/index.ts"]

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```
2+
bun install
3+
bun run deploy
4+
```

biome.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": true,
10+
"includes": ["**", "!node_modules/**", "!dist/**", "!.biome/**"]
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2
16+
},
17+
"linter": {
18+
"enabled": true,
19+
"rules": {
20+
"recommended": true,
21+
"suspicious": {
22+
"noUnknownAtRules": "off"
23+
}
24+
}
25+
},
26+
"assist": {
27+
"actions": {
28+
"source": {
29+
"organizeImports": "on"
30+
}
31+
}
32+
}
33+
}

bun.lock

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "template-honojs",
3+
"type": "module",
4+
"scripts": {
5+
"build": "bun build ./src/index.ts --target bun --outfile ./dist/index.js",
6+
"zip": "zip -j lambda.zip dist/index.js",
7+
"update": "aws lambda update-function-code --zip-file fileb://lambda.zip --function-name hello",
8+
"deploy": "bun run build && bun run zip && bun run update",
9+
"dev": "bun --watch run src/index.ts"
10+
},
11+
"dependencies": {
12+
"hono": "^4.9.6"
13+
},
14+
"devDependencies": {
15+
"@biomejs/biome": "2.2.3"
16+
}
17+
}

src/configs/.gitkeep

Whitespace-only changes.

src/controllers/.gitkeep

Whitespace-only changes.

src/db/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)