{"id":21424143,"url":"https://github.com/linhntaim/render-man","last_synced_at":"2026-05-01T02:32:02.772Z","repository":{"id":40637072,"uuid":"226692399","full_name":"linhntaim/render-man","owner":"linhntaim","description":"A middle man, also a module and an application, wants to render your SPA on the server.","archived":false,"fork":false,"pushed_at":"2023-01-08T22:39:39.000Z","size":870,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T16:59:04.367Z","etag":null,"topics":["application","manager","node","node-js","nodejs","prerender","prerender-io","render","seo","server","spa"],"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/linhntaim.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":"2019-12-08T15:54:55.000Z","updated_at":"2022-06-27T06:55:53.000Z","dependencies_parsed_at":"2023-02-08T07:46:01.879Z","dependency_job_id":null,"html_url":"https://github.com/linhntaim/render-man","commit_stats":null,"previous_names":["linhntaim/prerender"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Frender-man","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Frender-man/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Frender-man/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Frender-man/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linhntaim","download_url":"https://codeload.github.com/linhntaim/render-man/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933374,"owners_count":20370988,"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":["application","manager","node","node-js","nodejs","prerender","prerender-io","render","seo","server","spa"],"created_at":"2024-11-22T21:19:53.253Z","updated_at":"2026-05-01T02:31:57.735Z","avatar_url":"https://github.com/linhntaim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# render-man\n\nA middle man, also a module and an application, wants to render your SPA on the server.\n\n## 1. As a module\n\n### 1.1. Install\n\n```shell script\nnpm install render-man\n```\n### 1.2. Usage\n\nCreate a `.js` file (such as `server.js`) with the following basic content:\n\n```javascript\n// server.js\n\nconst {parseEnv} = require('dotenv-packed')\nconst RenderServerManager = require('render-man')\n\nparseEnv()\n\nRenderServerManager.start()\n```\n\n... then run it:\n\n```shell script\nnode server.js\n```\n\n*Note: As default, [Google Chrome](https://www.google.com/linuxrepositories/) is required to run. Please install it first.*\n\n### 1.3. Configuration\n\nCreate an `.env` file along with application script (`server.js`) and make some configurations on it.\n\nSee [3. Configuration](#3-configuration) for environment variables that can be set.\n\n## 2. As an application\n\n### 2.1. The Google Chrome\n\nInstall [Google Chrome](https://www.google.com/linuxrepositories/).\n\n### 2.2. The Application\n\nHere are things to guide you to install on Ubuntu.\n\n#### 2.2.1. Make the application run\n\n- Clone and prepare the application:\n\n```shell script\n# Clone the application to /var/www/render-man\ncd /var/www\ngit clone https://github.com/linhntaim/render-man.git render-man\n\n# Go install modules and create a folder for logging\ncd render-man\nnpm install\nmkdir logs\n```\n\n- Copy and edit the environment variables files (`.env`). (*See [3. Configuration](#3-configuration) for more detail about what you should modify any value*)\n\n```shell script\ncp .env.example .env\nvi .env\n```\n\n- Install the `supervisor` and use it to handle the application's running.\n\n```shell script\n# Install supervisor\nnpm update \u0026\u0026 apt install supervisor -y\n\n# Create a configuration to run the application with supervisor\ncat \u003e /etc/supervisor/conf.d/render-man.conf\n[program:render-man]\nprocess_name=%(program_name)s_%(process_num)02d\ndirectory=/var/www/render-man\ncommand=npm start\nautostart=true\nautorestart=true\nnumprocs=1\nenvironment=NODE_ENV=production\nstderr_logfile=/var/www/render-man/logs/err.log\nstdout_logfile=/var/www/render-man/logs/out.log\n^Z\n\n# Update the configuration so supervisor can recognize it\nsupervisorctl reread\nsupervisorctl update\n\n# Start the application\nsupervisorctl start render-man:*\n```\n\n- Now, the application is running. If troubles happen, try those commands:\n\n```shell script\n# Restart the application\nsupervisorctl restart render-man:*\n\n# Or if you want to stop first,\nsupervisorctl stop render-man:*\n# ... then make some changes ...\n# ... And finally, start it again.\nsupervisorctl start render-man:*\n``` \n\n- Do not forget to check the log files at where you have configured in `supervisor`.\n\n```shell script\n/var/www/render-man/logs/err.log\n/var/www/render-man/logs/out.log\n```\n\n#### 2.2.2. Use NGINX as a proxy server to the application:\n\n- Firstly, make a NGINX configuration file such as `render-man.conf` (in folder `etc/nginx`):\n\n```\nindex index.html;\n\nlocation / {\n    try_files $uri @renderman;\n}\n\nlocation @renderman {\n    set $renderman 0;\n    if ($http_user_agent ~* \"googlebot|bingbot|bingpreview|yandex|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest\\/0\\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp\") {\n        set $renderman 1;\n    }\n    if ($args ~ \"_escaped_fragment_\") {\n        set $renderman 1;\n    }\n    if ($http_user_agent ~ \"Prerender\") {\n        set $renderman 0;\n    }\n    if ($uri ~* \"\\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|doc|txt|ico|rss|zip|mp3|rar|exe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|iso|flv|m4v|torrent|ttf|woff|svg|eot)\") {\n        set $renderman 0;\n    }\n\n    if ($renderman = 1) {\n        set $port 3000; # Port to run the application, set in .env file\n        set $renderman \"localhost:${port}\";\n        rewrite .* /$scheme://$host$request_uri? break;\n        proxy_pass http://$renderman;\n    }\n    if ($renderman = 0) {\n        rewrite .* /index.html?$query_string break;\n    }\n}\n```\n\n- Secondly, just include the configuration in some domain's settings:\n\n```\nserver {\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n\n    server_name render-man.com www.render-man.com;\n\n    include ssl.conf;\n\n    root /var/www/render-man;\n\n    include render-man.conf; # Render-Man configuration\n}\n```\n\n- Visit your site to check if the application works (remember to append the url by `?_render_man_=1`):\n\n```\nhttps://render-man.com?_render_man_=1\n```\n\n## 3. Configuration\n\nYou can make some configuration via `.env` file. \n\n*View [`.env.example`](https://github.com/linhntaim/render-man/blob/master/.env.example) file for example.*\n        \n- **`PORT`**\n    \n    - Port for the application to run\n    - Default: `3000`.\n    \n- **`LOG_REQUESTS`**\n\n    - See [`logRequests`](https://github.com/renderman/renderman#logrequests).\n    - Default: `false`.\n    \n- **`PAGE_DONE_CHECK_INTERVAL`**\n\n    - See [`pageDoneCheckInterval`](https://github.com/renderman/renderman#pagedonecheckinterval).\n    - Default: `1000`.\n    \n- **`PAGE_LOAD_TIMEOUT`**\n\n    - See [`pageLoadTimeout`](https://github.com/renderman/renderman#pageloadtimeout).\n    - Default: `20000`.\n    \n- **`WAIT_AFTER_LAST_REQUEST`**\n\n    - See [`waitAfterLastRequest`](https://github.com/renderman/renderman#waitafterlastrequest).\n    - Default: `500`.\n    \n- **`FOLLOW_REDIRECTS`**\n\n    - See [`followredirects`](https://github.com/renderman/renderman#followRedirects).\n    - Default: `false`.\n    \n- **`CHROME_LOCATION`**\n\n    - See [`chromeLocation`](https://github.com/renderman/renderman#chromelocation).\n    - Default: `\u003cempty\u003e`.\n    \n- **`CHROME_FLAGS`**\n\n    - Run Google Chrome with some options.\n    - Each option should be wrapped by double quotes (`\"`) and separated by the comma (`,`). All should lie inside brackets (`[...]`).\n        - Example: `CHROME_FLAGS=[\"--no-sandbox\",\"--headless\"]`\n    - If there are no options, please leave it as blank inside brackets.\n        - Example: `CHROME_FLAGS=[]`.\n    - Default: `[\"--no-sandbox\",\"--headless\",\"--disable-gpu\"]`.\n\n- **`USE_PLUGINS`**\n    \n    - Plugins can be used:\n        - `basicAuth`\n            - See [`basicAuth`](https://github.com/renderman/renderman#basicauth).\n            - Extra environment variables can be added in `.env` files: `BASIC_AUTH_USERNAME`, `BASIC_AUTH_PASSWORD`.\n        - `removeScriptTags`\n            - See [`removeScriptTags`](https://github.com/renderman/renderman#removescripttags).\n        - `blockedResources`\n        - `httpHeaders`\n            - See [`httpHeaders`](https://github.com/renderman/renderman#httpheaders).\n        - `whitelist`\n            - See [`whitelist`](https://github.com/renderman/renderman#whitelist).\n        - `blacklist`\n            - See [`blacklist`](https://github.com/renderman/renderman#blacklist).\n        - `in-memory-cache`\n            - See [`in-memory-cache`](https://github.com/renderman/renderman#in-memory-cache).\n    - Each plugin should be wrapped by double quotes (`\"`) and separated by the comma (`,`). All should lie inside brackets (`[...]`).\n        - Example: `USE_PLUGINS=[\"removeScriptTags\",\"blockedResources,\"httpHeaders\"]`\n    - If there are no plugins, please leave it as blank inside brackets.\n        - Example: `USE_PLUGINS=[]`.\n    - Default: `[]`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinhntaim%2Frender-man","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinhntaim%2Frender-man","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinhntaim%2Frender-man/lists"}