diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d664255 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md index 700bea3..5381edc 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) diff --git a/package.json b/package.json index ab7ca39..b318c92 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -10,5 +15,21 @@ "devDependencies": { "@types/node": "^20.11.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" }