{"id":17974691,"url":"https://github.com/vadorequest/serverless-ssr-hbs","last_synced_at":"2026-05-07T15:35:41.497Z","repository":{"id":73629824,"uuid":"123314259","full_name":"Vadorequest/serverless-ssr-hbs","owner":"Vadorequest","description":"This is a simple project/boilerplate that put Serverless and Handlebars together in order to do simple Server Side Rendering.","archived":false,"fork":false,"pushed_at":"2019-12-27T00:17:54.000Z","size":11,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T22:05:23.263Z","etag":null,"topics":["aws","aws-lambda","handlebars","serverless-framework","ssr"],"latest_commit_sha":null,"homepage":"","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/Vadorequest.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":"2018-02-28T16:51:00.000Z","updated_at":"2025-05-08T19:24:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"722d8b63-2e03-4108-9d6d-320ccff8e1b5","html_url":"https://github.com/Vadorequest/serverless-ssr-hbs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vadorequest/serverless-ssr-hbs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vadorequest%2Fserverless-ssr-hbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vadorequest%2Fserverless-ssr-hbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vadorequest%2Fserverless-ssr-hbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vadorequest%2Fserverless-ssr-hbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vadorequest","download_url":"https://codeload.github.com/Vadorequest/serverless-ssr-hbs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vadorequest%2Fserverless-ssr-hbs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32744055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["aws","aws-lambda","handlebars","serverless-framework","ssr"],"created_at":"2024-10-29T17:15:01.522Z","updated_at":"2026-05-07T15:35:41.481Z","avatar_url":"https://github.com/Vadorequest.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple SSR with Serverless and Handlebars\n=\n\nThis is a simple project/boilerplate that put Serverless and Handlebars together in order to do simple Server Side Rendering.\n\nIt's probably the perfect fit if you just need a bit of SSR for powering a react application or other kind-of-static content but still need a pre-fetch databse or stuff like that.\n\nRoutes are handled server side and not client side.\n\n# Getting started (TL;DR)\n\n- `nvm use` (if you use nvm, or make sure you're on node 6.10.x)\n- `npm i`\n- `npm start`\n- Open `http://localhost:3000/status` and `http://localhost:3000`\n\n---\n\n# Requirements\n\n- Node 6.10.x, see [.nvmrc](./.nvmrc)\n- Need AWS account if you want to test it against AWS\n\n# Limitations\n\n- Only works with AWS provider (due to the plugin `serverless-offline` which only works for AWS), \nbut other provider could be added if you remove that particular dependency. (And optionally remove the AWS-specific env variables used)\n- Aimed at small projects, especially SPA, etc.\n- Could potentially host many pages for a bigger app since there is a built-in partials and helpers\n\n\n# Features\n\n- Development environment (much faster than testing against AWS) using `serverless-offline`\n- Renders HTML based on `hbs` (Handlebars) templates\n- Ability to use partials/helpers and alike\n- Error handling (server side) using [stacktrace-js](https://www.stacktracejs.com/#!/docs/stacktrace-js)\n- Built-in helper and example to send JSON from server to client and use it with JavaScript\n- `hbs` files are packaged by webpack and usable through `const template = import './path/to/template''`\n- `hbs` templates automatically come with partials/helpers attached\n- Simple partial/helper example\n- Source maps support (basically shows the right line when errors arise, even though it's webpacked) _Beware: multiple webpack rebuilds mess it up, line number gets wrong, but works fine if you restart serverless, and works fine in production_\n- Additional helpers to programmatically figure out if code is running on AWS or not\n- Babel transpilation to node 6.10\n- A `status` page with interesting information for debug\n- _No test (oops)_\n\n# External documentation\n\n- Handlebars: https://github.com/pcardune/handlebars-loader (very much needed)\n- Serverless Offline: https://github.com/dherault/serverless-offline\n\n# Error handling example:\n\nManually added a `throw new Error('dieee')` in [./src/functions/status/status.js:7](./src/functions/status/status.js)\n\nBrowser returns I\"nternal server error\" (like always on AWS)\n\n```json\n{\"message\": \"Internal server error\"}\n```\n\nYou need to use `sls logs -f status` to see logs for the `status` function\n\n```\nSTART RequestId: 22906516-1ca5-11e8-9f36-f9b1957a11c4 Version: $LATEST\n2018-02-28 17:33:41.818 (+01:00)        22906516-1ca5-11e8-9f36-f9b1957a11c4    error Error: dieee\n    at /var/task/src/functions/status/webpack:/src/functions/status/status.js:7:11\n    at next (native)\n    at step (/var/task/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)\n    at /var/task/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14\n    at Promise.F (/var/task/node_modules/core-js/library/modules/_export.js:35:28)\n    at /var/task/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12\n    at handler (/var/task/src/functions/status/status.js:130:17)\n    at invoke (/var/runtime/node_modules/awslambda/index.js:285:5)\n    at InvokeManager.start (/var/runtime/node_modules/awslambda/index.js:151:9)\n    at Object.awslambda.waitForInvoke (/var/runtime/node_modules/awslambda/index.js:479:52)\n2018-02-28 17:33:41.819 (+01:00)        22906516-1ca5-11e8-9f36-f9b1957a11c4    stackTrace { columnNumber: 11,\n  lineNumber: 7,\n  fileName: '/var/task/src/functions/status/webpack:/src/functions/status/status.js',\n  source: '    at /var/task/src/functions/status/webpack:/src/functions/status/status.js:7:11' }\nEND RequestId: 22906516-1ca5-11e8-9f36-f9b1957a11c4\nREPORT RequestId: 22906516-1ca5-11e8-9f36-f9b1957a11c4  Duration: 228.39 ms     Billed Duration: 300 ms         Memory Size: 256 MB     Max Memory Used: 26 MB  \n```\n\n# Status page\n\nRenders the following (on AWS)\n\n```json\n{\n  \"status\": \"running\",\n  \"isHostedOnAWS\": true,\n  \"aws\": {\n    \"region\": \"us-east-1\",\n    \"root\": \"/var/task\",\n    \"runtimeDir\": \"/var/runtime\",\n    \"function\": {\n      \"name\": \"serverless-ssr-hbs-development-status\",\n      \"memory\": \"256\",\n      \"version\": \"$LATEST\"\n    }\n  },\n  \"env\": \"development\",\n  \"time\": \"2018-02-28T16:28:27.801Z\",\n  \"projectRoot\": \"/var/task\",\n  \"__dirname\": \"src/functions/status\",\n  \"absoluteDirname\": \"/var/task/src/functions/status\"\n}\n```\n\nRenders the following (local)\n\n```json\n{\n  \"status\": \"running\",\n  \"isHostedOnAWS\": false,\n  \"aws\": {\n    \"function\": {}\n  },\n  \"env\": \"development\",\n  \"time\": \"2018-02-28T16:45:05.753Z\",\n  \"projectRoot\": \"/Users/vadorequest/dev/serverless-ssr-hbs\",\n  \"__dirname\": \"src/functions/status\",\n  \"absoluteDirname\": \"/Users/vadorequest/dev/serverless-ssr-hbs/src/functions/status\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvadorequest%2Fserverless-ssr-hbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvadorequest%2Fserverless-ssr-hbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvadorequest%2Fserverless-ssr-hbs/lists"}