{"id":21616256,"url":"https://github.com/arafipro/stock-trade-api-routing","last_synced_at":"2026-04-11T13:03:25.876Z","repository":{"id":244915905,"uuid":"816613516","full_name":"arafipro/stock-trade-api-routing","owner":"arafipro","description":"【Cloudflare Workers】Bun+HonoでREST APIを作成① 効果的なhonoルーティングの秘訣","archived":false,"fork":false,"pushed_at":"2024-06-30T00:51:29.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T20:46:53.006Z","etag":null,"topics":["bun","cloudflare","cloudflare-d1","cloudflare-workers","drizzle-orm","hono","typescript","youtube"],"latest_commit_sha":null,"homepage":"https://youtu.be/21FEPVYR7Vg","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arafipro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-18T04:59:31.000Z","updated_at":"2024-06-30T00:51:32.000Z","dependencies_parsed_at":"2024-06-18T09:24:30.215Z","dependency_job_id":null,"html_url":"https://github.com/arafipro/stock-trade-api-routing","commit_stats":null,"previous_names":["arafipro/stock-trade-api-01","arafipro/stock-trade-api-routing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arafipro%2Fstock-trade-api-routing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arafipro%2Fstock-trade-api-routing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arafipro%2Fstock-trade-api-routing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arafipro%2Fstock-trade-api-routing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arafipro","download_url":"https://codeload.github.com/arafipro/stock-trade-api-routing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244267475,"owners_count":20425835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","cloudflare","cloudflare-d1","cloudflare-workers","drizzle-orm","hono","typescript","youtube"],"created_at":"2024-11-24T22:14:05.267Z","updated_at":"2025-12-30T22:45:15.871Z","avatar_url":"https://github.com/arafipro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 【Cloudflare Workers】Bun+HonoでREST APIを作成① 効果的なhonoルーティングの秘訣\n\n## YouTube\n\n[![\"【Cloudflare Workers】Bun+HonoでREST APIを作成① 効果的なhonoルーティングの秘訣\"](https://i.ytimg.com/vi/jaYkXW8II-k/maxresdefault.jpg)](https://youtu.be/jaYkXW8II-k)\n\n## 技術選定\n\n- Bun\n- TypeScript\n- Hono\n- Drizzle\n- Cloudflare Workers\n- Cloudflare D1\n\n## 初期設定\n\n### NodeModule をインストール\n\n```bash\nbun install\n```\n\n### データベースを作成\n\n```bash\nnpx wrangler d1 create stock-trade-db\n```\n\n### wrangler.toml に追記\n\n```toml\n[[d1_databases]]\nbinding = \"DB\"\ndatabase_name = \"stock-trade-db\"\ndatabase_id = \"\u003cunique-ID-for-your-database\u003e\"\n```\n\n`\u003cunique-ID-for-your-database\u003e`はデータベースを作成したときに出力されるID\n\n### テーブルのスキーマを作成\n\n```bash\nnpx drizzle-kit generate\n```\n\n### ローカルデータベースにテーブルを作成\n\n```bash\nnpx wrangler d1 migrations apply stock-trade-db --local\n```\n\n### リモートデータベースにテーブルを作成\n\n```bash\nnpx wrangler d1 migrations apply stock-trade-db --remote\n```\n      \n## テーブル\n\n### テーブル名 stock_table\n\n| No. | カラム名   | データ型 | 主キー | 備考       |\n| --- | ---------- | -------- | :----: | ---------- |\n| 1   | code       | text     |   ○    | 証券コード |\n| 2   | stock_name | text     |        | 銘柄名     |\n| 3   | market     | text     |   　   | 市場       |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farafipro%2Fstock-trade-api-routing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farafipro%2Fstock-trade-api-routing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farafipro%2Fstock-trade-api-routing/lists"}