{"id":18426389,"url":"https://github.com/complate/complate-express","last_synced_at":"2025-04-13T18:54:21.168Z","repository":{"id":57204657,"uuid":"98042327","full_name":"complate/complate-express","owner":"complate","description":"complate integration for Express","archived":false,"fork":false,"pushed_at":"2018-06-30T11:28:46.000Z","size":9,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T08:26:50.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/complate.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}},"created_at":"2017-07-22T16:04:45.000Z","updated_at":"2018-06-30T11:28:39.000Z","dependencies_parsed_at":"2022-09-18T01:00:58.160Z","dependency_job_id":null,"html_url":"https://github.com/complate/complate-express","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/complate","download_url":"https://codeload.github.com/complate/complate-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766303,"owners_count":21158297,"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":[],"created_at":"2024-11-06T05:07:49.515Z","updated_at":"2025-04-13T18:54:21.149Z","avatar_url":"https://github.com/complate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# complate-express\n\n[Express](http://expressjs.com) adaptor for [complate](https://complate)\n\n\nGetting Started\n---------------\n\nInstall complate-express in your Express application:\n\n```\n$ npm install complate-express\n```\n\nRegister complate's middleware, then use `Response#complate` for rendering:\n\n```javascript\nlet express = require(\"express\");\nlet complate = require(\"complate-express\");\n\nlet app = express();\n// register complate middleware\napp.use(complate(\"/path/to/views.js\")));\n\napp.get(\"/\", (req, res) =\u003e {\n    res.complate(\"MyView\", { title: \"Hello World\" });\n});\n```\n\nViews are typically generated from JSX modules:\n\n```jsx\nimport { createElement } from \"complate-stream\";\n\nexport function MyView({ title }) {\n    return \u003carticle\u003e\n        \u003ch1\u003e{title}\u003c/h1\u003e\n        \u003cp\u003elorem ipsum dolor sit amet\u003c/p\u003e\n    \u003c/article\u003e;\n}\n\n// host API\nexport default (view, params, stream, fragment, callback) =\u003e {\n    return renderer.renderView(view, params, stream, { fragment }, callback);\n};\n```\n\nThese JSX modules are then combined into a single `views.js` bundle, e.g. using\n[faucet](https://faucet-pipeline.org) - see\n[complate-sample-express](https://github.com/complate/complate-sample-express)\nfor details.\n\n\nAPI\n---\n\n`Request#complate(viewName, params, options)`\n\n* `viewName` identifies the view within the bundle\n* `params` is an object passed to the respective view macro\n* `options` is an optional object with the following members:\n    * `fragment`, if `true`, indicates that an HTML fragment (omitting doctype\n      and layout)\n    * `statusCode` sets the HTTP status code (defaults to `200`)\n    * `contentType` sets the corresponding HTTP response header (defaults to\n      `\"text/html\"`)\n\nIf Express's view cache is disabled, the bundle will be reloaded for each\nrequests (useful for development).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomplate%2Fcomplate-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomplate%2Fcomplate-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomplate%2Fcomplate-express/lists"}