{"id":31846875,"url":"https://github.com/frojd/hastur","last_synced_at":"2025-10-12T09:17:31.955Z","repository":{"id":25970783,"uuid":"101027516","full_name":"Frojd/Hastur","owner":"Frojd","description":"Small node http server for rendering of react components","archived":false,"fork":false,"pushed_at":"2023-01-23T20:49:46.000Z","size":461,"stargazers_count":13,"open_issues_count":18,"forks_count":0,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-04-15T02:44:28.467Z","etag":null,"topics":["node","react","server-side-rendering"],"latest_commit_sha":null,"homepage":null,"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/Frojd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-22T06:09:56.000Z","updated_at":"2023-12-20T10:26:58.000Z","dependencies_parsed_at":"2023-02-13T03:05:32.336Z","dependency_job_id":null,"html_url":"https://github.com/Frojd/Hastur","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Frojd/Hastur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2FHastur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2FHastur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2FHastur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2FHastur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frojd","download_url":"https://codeload.github.com/Frojd/Hastur/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2FHastur/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010964,"owners_count":26084837,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["node","react","server-side-rendering"],"created_at":"2025-10-12T09:17:31.192Z","updated_at":"2025-10-12T09:17:31.943Z","avatar_url":"https://github.com/Frojd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hastur\r\nA small node http server for rendering of react components (must be transpiled if using experimental features not found in node.js)\r\n\r\n## Requirements\r\n- Node.js \u003e 8.x\r\n\r\n## Installation \u0026 start\r\n1. npm install git://github.com/Frojd/Hastur.git\r\n2. node hastur.js\r\n\r\nor\r\n\r\n1. Use docker image: frojd/hastur\r\n\r\n## Server configurations\r\n\r\nAs env variables:\r\n```\r\n    HASTUR_PATH=/path/to/components/\r\n    HASTUR_PORT=3000\r\n    HASTUR_HOST=0.0.0.0\r\n    HASTUR_DEBUG=true\r\n    HASTUR_SENTRY=https://xxxx:yyyy@sentry.io/1234\r\n    HASTUR_JSON_SNAKE_TO_CAMEL=true\r\n    HASTUR_STRIP_DOT_PREFIX=true\r\n```\r\n\r\nor as parameters:\r\n\r\n    node app.js --port 3000 --host 0.0.0.0 --path /path/to/components/ --sentry https://xxxx:yyyy@sentry.io/1234 --debug --toCamelFromSnake --stripDotPrefix\r\n\r\n\r\n## How to use\r\n\r\nWhen started without any parameters, Hastur will accept application/json http POST request at http://localhost:3000 with this body:\r\n\r\n```json\r\n{\r\n  \"componentName\": \"MyComponent\",\r\n  \"props\": {\r\n    \"title\": \"my props title\",\r\n    \"anyProp\": \"another prop\"\r\n  },\r\n  \"static\": false,\r\n  \"context\": {\r\n    \"location\": \"https://mysite.com\",\r\n    \"otherContext\": \"foo\"\r\n  }\r\n}\r\n```\r\n\r\nThe above request will try to do a require(`componentName`) and render it with the passed along `props`.\r\nIf `HASTUR_PATH` is set, it will be prepended to the `componentName`.\r\n\r\n**`static` (optional, default: false):**\r\n\r\nIf true, Hastur will return html without react bindings\r\n\r\n **`context` (optional, default: undefined)**\r\n\r\nIf you need to pass along things that otherwise would not be included on the server side (such as request-info)\r\nyou can pass it along in the `context` attribute:\r\n\r\n```json\r\n{\r\n  \"location\": \"https://somesite.com/foo\"\r\n}\r\n```\r\n\r\nYou can access it in your components via the `SSRContext` object, allowing you to do stuff like:\r\n\r\n```js\r\nconst currentURL = SSRContext.location ? SSRContext.location : window.location;\r\nif (currentURL.search(/foo/)) {\r\n  console.log('The requested URL contains \"foo\"');\r\n}\r\n```\r\n\r\n\r\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c Updated upstream\r\n## How to build components\r\n\r\nComponents is easiest built through babel-cli:\r\n\r\n```\r\n    .\\node_modules\\.bin\\babel componentsfolder --out-dir raw --no-babelrc --plugins=transform-class-properties,transform-object-rest-spread --presets=react,env\r\n```\r\n\r\n=======\r\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e Stashed changes\r\n## Extras\r\n\r\nComes by default with optional sentry logging, if you do not plan to use it, please install with the `--no-optional` flag\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrojd%2Fhastur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrojd%2Fhastur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrojd%2Fhastur/lists"}