Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
xkeshav committed May 30, 2024
2 parents 69f2a78 + efde569 commit 82f8b2a
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 4 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node.js workflow hono

on:
push:
branches:
- 'develop'
- 'master'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm ci
- run: npm run build --if-present
- run: npm run dev
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Keshav Mohta

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
55 changes: 52 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hono Talk

This is related to hono talk to understand basic things about hono.
This is related to hono talk to understand basic things about honojs.

## How to start

Expand All @@ -13,6 +13,55 @@ and this will open [http://localhost:3000](http://localhost:3000)

## Examples

### index.html
Here are few examples with honojs

> basic page to start with
### Text response

- use of `c.text()`
- endpoint: `/`

### Custom Header

- use of `c.header()` and `c.body()`
- endpoint: `/welcome`

### Multiple paths

- multiple path return same page; no redirect logic
- endpoint: `/hello` or `/hey` or `/hi`

### JSON response

- use of `c.json()`
- endpoint: `/json/list`

### HTML response

- use of `c.html()`
- endpoint: `/html/list`

### CSS Support

- `/color/`

- `/color/rainbow`

### Path Params and Query Params

- add any valid color in place of *white* as a path params
- endpoint: `/color/white`

---

- change font size with query params `sz`
- endpoint: `/color/white?sz=3`

### JSX Support

- use of reusable component like react
- endpoint: `/alphabet`


## Author

Keshav Mohta | [@xkeshav](https://www.xkeshav.com)
23 changes: 22 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"name": "o_ho_no",
"version": "1.0.0",
"private": false,
"publisher": "@xkeshav",
"description": " example for honojs learning; used in talks",
"scripts": {
"dev": "tsx watch src/index.tsx",
"build": "tsx ./build.ts"
Expand All @@ -12,5 +17,21 @@
"@types/node": "^20.11.17",
"esbuild": "^0.16.17",
"tsx": "^3.12.2"
}
},
"keywords": ["honojs", "hono", "server", "typescript"],
"author": {
"name": "Keshav Mohta",
"email" : "xkeshav@gmail.com"
},
"contributors": [],
"license": "see LICENSE in LICENSE",
"repository": {
"type": "git",
"url": "https://github.com/xkeshav/to_ho_no.git"
},
"bugs": {
"url": "https://github.com/xkeshav/o_ho_no/issues",
"email": "xkeshav@gmail.com"
},
"homepage": "https://github.io/o_ho_no"
}

0 comments on commit 82f8b2a

Please sign in to comment.