{"id":25395993,"url":"https://github.com/githubplayerzero/json-server-test-hex","last_synced_at":"2025-04-10T20:18:29.538Z","repository":{"id":276757338,"uuid":"928850798","full_name":"GitHubPlayerZero/json-server-test-hex","owner":"GitHubPlayerZero","description":"使用六角的範例專案作為 json-server 樣本，測試部署於 Render Server。","archived":false,"fork":false,"pushed_at":"2025-02-27T04:15:41.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T04:39:19.083Z","etag":null,"topics":["json-server","render-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitHubPlayerZero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"custom":["https://www.buymeacoffee.com/kitloong"]}},"created_at":"2025-02-07T10:57:53.000Z","updated_at":"2025-02-27T04:15:44.000Z","dependencies_parsed_at":"2025-02-10T09:31:00.030Z","dependency_job_id":"ac3a108e-437c-4420-83c8-feed1a1571a1","html_url":"https://github.com/GitHubPlayerZero/json-server-test-hex","commit_stats":null,"previous_names":["githubplayerzero/json-server-test-hex"],"tags_count":0,"template":false,"template_full_name":"gonsakon/json-server-vercel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHubPlayerZero%2Fjson-server-test-hex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHubPlayerZero%2Fjson-server-test-hex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHubPlayerZero%2Fjson-server-test-hex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHubPlayerZero%2Fjson-server-test-hex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitHubPlayerZero","download_url":"https://codeload.github.com/GitHubPlayerZero/json-server-test-hex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248289313,"owners_count":21078913,"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":["json-server","render-server"],"created_at":"2025-02-15T20:56:43.264Z","updated_at":"2025-04-10T20:18:29.534Z","avatar_url":"https://github.com/GitHubPlayerZero.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/kitloong"],"categories":[],"sub_categories":[],"readme":"# JSON Server with Render\n\n- [專案拷貝來源](https://github.com/gonsakon/json-server-vercel)\n\n由於 Vercel 無法長時間保留資料，所以此專案會用來部署於 **Render**，故將 Vercel 相關設定移除。\u003cbr\u003e\n原說明亦不再適用於本專案，因此移除之。\n\n---\n\n## 於 Render 運行\n下載此專案後，上傳到自己的 GitHub，再於 [Render](https://render.com/) 中部署專案即可使用。\n\n---\n\n## 本機運行\n下載後若想運行於本機，請先安裝套件：\n```javascript\nnpm i\n```\n\n\u003cbr\u003e\n\n### 腳本說明\n- `npm run start`\u003cbr\u003e\n  啟動 Node Server 作為 JSON Server 服務，異動資料時**不會**實際寫入 db.json，**具有身份驗證功能**。\u003cbr\u003e\n  **註：** 部署於 Render 的運行方式屬於此種，因此資料不會實際寫入 db.json，只會暫存於 Render 中，當有休眠或重啟伺服器時即會釋放。\n  \n- `npm run watch`\u003cbr\u003e\n  直接啟動 JSON Server 服務，**本機**須安裝 json-server 套件於**全域**，資料**會**實際寫入 db.json，本身**不**具有身份驗證功能。\n  \n- `npm run auth`\u003cbr\u003e\n  啟動 JSON Server Auth 服務（本身亦為 JSON Server 服務），須於**此專案中**安裝 json-server、json-server-auth 套件，資料**會**實際寫入 db.json，**具有身份驗證功能**。\n\n\u003cbr\u003e\n\n### JSON Server URL\nhttp://localhost:3000/\n\n---\n\n## 範例說明\nsample 資料夾中提供測試的寫法範例（本機測試），可以拷貝至另外的專案進行測試，**測試時請打開 console 觀看訊息**。\u003cbr\u003e\n若想與 json-server 同一個專案測試，請以 `npm run start` 啟動 json-server，這樣才不會因為實際異動到 db.json 而使專案自動重整，造成無法觀看 console 訊息。\u003cbr\u003e\n😉 但建議最好的方式還是拷貝到另外的專案執行，這樣比較好實際觀察 db.json 的異動情形。\u003cbr\u003e\n\n測試程式：\n- **jsonServerTest.html：** 測試 json-server 各種寫法。\n- **jsonServerAuthTest.html：** 測試 json-server-auth 身份驗證。\n\n---\n\n## 其它\ndb.json.original 為原本的測試檔案，內容較乾淨，提供給有需要者自行替換。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubplayerzero%2Fjson-server-test-hex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithubplayerzero%2Fjson-server-test-hex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubplayerzero%2Fjson-server-test-hex/lists"}