{"id":22202213,"url":"https://github.com/rumkin/plant-browser-demo","last_synced_at":"2026-02-18T13:02:12.423Z","repository":{"id":152260201,"uuid":"206707564","full_name":"rumkin/plant-browser-demo","owner":"rumkin","description":"Nodeless web server demo","archived":false,"fork":false,"pushed_at":"2019-09-08T01:04:54.000Z","size":29,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T03:52:47.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rumkin.github.io/plant-browser-demo/","language":null,"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/rumkin.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":"2019-09-06T03:44:46.000Z","updated_at":"2025-01-02T02:39:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2aa08da-4b92-4f02-b3d6-7a1c5865fde3","html_url":"https://github.com/rumkin/plant-browser-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rumkin/plant-browser-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fplant-browser-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fplant-browser-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fplant-browser-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fplant-browser-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rumkin","download_url":"https://codeload.github.com/rumkin/plant-browser-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fplant-browser-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29580639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-12-02T16:12:46.675Z","updated_at":"2026-02-18T13:02:12.403Z","avatar_url":"https://github.com/rumkin.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plant Browser Demo\n\nThis is a single-file demo web application. Its' purpose is to show how to develop fully functional web server with test coverage without Node.js using only browser and code editor.\n\n## Usage\n\n1. Save [page](doc/index.html) on disk.\n2. Open it in code editor.\n3. Update `#Server` and `#Spec` scripts code.\n4. Refresh the page. DevTools console should contain complete output of your test.\n\n## Dependencies\n\n* [Plant](https://github.com/rumkin/plant).\n* [TestUp](https://github.com/rumkin/testup).\n* [TinyAssert](https://github.com/rumkin/tiny-assert).\n\n\n## Structure overview\n\nCode of the example is structured into several scripts. Each\nscript contains code related to specific task.\n\n```html\n\u003cscript id=\"Server\"\u003e\u003c/script\u003e\n\u003cscript id=\"Spec\"\u003e\u003c/script\u003e\n\u003cscript id=\"TestupHelpers\"\u003e\u003c/script\u003e\n\u003cscript id=\"PlantHelpers\"\u003e\u003c/script\u003e\n\u003cscript id=\"Main\"\u003e\u003c/script\u003e\n```\n\nWhere:\n\n* `#Server`. Your http API code.\n* `#Spec`. Your tests for the API.\n* `#TestupHelpers`. Definition of custom TestUp reporter. required by this script.\n* `#PlantHelpers`. Definition for running Plant requests in browser.\n* `#Main`. UI bindings and code which is tieing up all previous scripts and run app tests.\n\n## Server with comments\n\nServer code is located in script `#Server` and looks like this:\n\n```js\nfunction createServer() {\n  // Instantiate Plant server\n  const plant = new Plant()\n\n  // Create API router. It's not necessary, but\n  // extremely useful for modular API creation.\n  const router = new PlantRouter()\n\n  // Define simple hello world route\n  router.get('/hello-world', ({res}) =\u003e {\n    res.body = 'Hello, World!'\n  })\n\n  // Mount router. Pay attention to asterisk in the route\n  // without it router will not be reachable.\n  plant.use('/api/v1/*', router)\n\n  // Return configured server\n  return plant\n}\n```\n\n## Spec with comments\n\nTests code is located in script `#Spec` and looks like this:\n\n```js\n// describe and it are TestUp's framework methods\n// which builds test scenario\nfunction createSpec({describe, it}) {\n  describe('Server', () =\u003e {\n    describe('Router', () =\u003e {\n\n      // Define test:\n      // Require `request` from test scope.\n      it('Should handle request', async ({request}) =\u003e {\n        // Send request to server, using `request`.\n        const res = await request('/api/v1/hello-world')\n\n        // Validate response with TinyAssert accessible globally as `assert`.\n        assert.equal(res.body, 'Hello, World', 'expect res.body \"Hello, World!\"')\n      })\n    })\n  })\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fplant-browser-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frumkin%2Fplant-browser-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fplant-browser-demo/lists"}