{"id":22008822,"url":"https://github.com/lasalefamine/http-server-pwa","last_synced_at":"2026-03-07T02:33:45.192Z","repository":{"id":26529188,"uuid":"109333727","full_name":"LasaleFamine/http-server-pwa","owner":"LasaleFamine","description":":space_invader: http-server alike but for serving and rendering PWA: pwa-server","archived":false,"fork":false,"pushed_at":"2025-07-22T05:37:50.000Z","size":1576,"stargazers_count":15,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T08:19:47.990Z","etag":null,"topics":["bot-render","cli","expressjs","hacktoberfest","historyapifallback","http-server","indexing","puppeteer","pwa","pwa-server"],"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/LasaleFamine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2017-11-03T00:40:54.000Z","updated_at":"2023-08-22T15:35:20.000Z","dependencies_parsed_at":"2024-03-27T00:31:57.788Z","dependency_job_id":"2785d01f-725b-44c5-adfd-171032cc9a98","html_url":"https://github.com/LasaleFamine/http-server-pwa","commit_stats":{"total_commits":123,"total_committers":9,"mean_commits":"13.666666666666666","dds":0.6260162601626016,"last_synced_commit":"afd33ee2f3b1583fda256f01bb335b8df0fcb7c5"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/LasaleFamine/http-server-pwa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fhttp-server-pwa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fhttp-server-pwa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fhttp-server-pwa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fhttp-server-pwa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasaleFamine","download_url":"https://codeload.github.com/LasaleFamine/http-server-pwa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fhttp-server-pwa/sbom","scorecard":{"id":82342,"data":{"date":"2025-08-11","repo":{"name":"github.com/LasaleFamine/http-server-pwa","commit":"afd33ee2f3b1583fda256f01bb335b8df0fcb7c5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 1/4 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"59 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-h452-7996-h45h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-jv35-xqg7-f92r","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T06:10:50.711Z","repository_id":26529188,"created_at":"2025-08-15T06:10:50.711Z","updated_at":"2025-08-15T06:10:50.711Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273567129,"owners_count":25128630,"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-09-04T02:00:08.968Z","response_time":61,"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":["bot-render","cli","expressjs","hacktoberfest","historyapifallback","http-server","indexing","puppeteer","pwa","pwa-server"],"created_at":"2024-11-30T02:07:22.119Z","updated_at":"2026-03-07T02:33:45.125Z","avatar_url":"https://github.com/LasaleFamine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http-server-pwa aka pwa-server\n\n[![npm](https://img.shields.io/npm/v/http-server-pwa.svg?style=flat)](https://github.com/LasaleFamine/http-server-pwa) [![Build Status](https://travis-ci.com/LasaleFamine/http-server-pwa.svg?branch=master\u0026style=flat)](https://travis-ci.com/LasaleFamine/http-server-pwa) [![Build status](https://ci.appveyor.com/api/projects/status/k5ssy06tt4ru1269?svg=true\u0026style=flat)](https://ci.appveyor.com/project/LasaleFamine/http-server-pwa) [![codecov](https://codecov.io/gh/LasaleFamine/http-server-pwa/badge.svg?branch=master\u0026style=flat)](https://codecov.io/gh/LasaleFamine/http-server-pwa?branch=master)\n\n\u003e http-server alike but for serving and rendering PWA: pwa-server\n\n## What\n\nThis is a different version (btw inspired by) of the insta-ready [http-server](https://github.com/indexzero/http-server), but with some key features to render Progressive Web Apps (or also SPA) correctly for bots like `googlebot` or Facebook crawlers, so your application can be crawled with its content already loaded. This should avoid the killing problem of the SEO for PWAs.\n\n**The server will render as normal, static ExpressJS server for your normal users.**\n\nWorth noting is that the server supports the `history-fallback` behavior. You maybe can avoid that ***#*** (hash) for your PWA navigation ✌️.\n\n## Features\n\nThe server is not \"dependecies-free\" like the original http-server and instead is powered by [ExpressJS](https://github.com/expressjs/express) under the hood and [Puppeter](https://github.com/GoogleChrome/puppeteer/) for render the pages to bots.\n\n* [pupperender](https://github.com/LasaleFamine/pupperender) - Puppeter middleware to render correctly the PWA content for the crawlers.\n* [express-history-api-fallback](https://www.npmjs.com/package/express-history-api-fallback) - to fallback correctly to the `index.html`.\n* [express-http-to-https](https://www.npmjs.com/package/express-http-to-https) - automatically redirect `http` requests to `https`.\n* [devcert](https://github.com/davewasmer/devcert) - Create development certificate on the fly for local `https`. **NOTE: you could be prompted to insert your password before starting the server. This is necessary of using OpenSSL. More info on devcert repository.**\n\n## Production usage\n\nThe server will not create any SSL certificate on the fly when you set `process.env.NODE_ENV = production` even if `--ssl` flag is passed down.\nYou have two alternatives here:\n- use a reverse proxy like [CloudFlare](https://cloudflare.com) and get free certification for your domain - easy peasy\n- use a custom reverse proxy like Nginx and load your certification from there\n\nI currently don't want to support a custom certificate load. PR are always welcome.\n\n## Deploy on Heroku\n\nIn order to make the server work as expected on Heroku services (even on free tier) you must add [the puppeteer-heroku-buildpack](https://github.com/jontewks/puppeteer-heroku-buildpack).\n\nSince recent changes on the platform it is **strongly** suggested to add it from source rather than the buildpack's catalogs.\n\n```bash\n$ heroku buildpacks:set https://github.com/jontewks/puppeteer-heroku-buildpack.git\n```\n\n## Usage\n\nYou can use it programmatically or as a [CLI](#CLI) tool (global or local).\n\n## Install\n\n```\n$ yarn add http-server-pwa\n```\n\n## Usage\n\n```js\nconst httpServerPwa = require('http-server-pwa');\n\nconst server = await httpServerPwa('./dist', {p: 3000});\n//=\u003e Server started -\u003e ./dist localhost:3000\n```\n\n## API\n\n### httpServerPwa(path, [options])\n\n#### path\n\nType: `string`\n\nPath to serve.\n\n#### options\n\n| Name | CLI flag | Type | Default | Description |\n|------|--------------|------|---------|-------------|\n| port | p | `number` | `8080` | Port to use for running the server. |\n| host | h | `string` | `localhost` | Host to use for running the server. |\n| fallback | f | `string` | `index.html` | Fallback HTML file name. |\n| https | s | `boolean` | `false` | Enable HTTPS redirect on `localhost`.|\n| ssl |  | `boolean` | `false` | Enable `devcert` auto-generation of SSL certification for development.|\n| cache | c | `boolean` | `false` | Enable cache for Puppeteer rendering|\n| cacheTTL |  | `number` | `3600` (s) | Seconds until cached content is disregarded and puppeterized again. Only considered when `cache` is true.|\n| debug | d | `boolean` | `false` | If or not show some logs.|\n| gzip | g | `boolean` | `false` | Enable serving of gzipped files if available|\n| brotli | b | `boolean` | `false` | Enable serving of brotli compressed files if available|\n\n\u003e Note: If the gzip and brotli option are both toggled, brotli compressed files will get precedence over gzipped files.\n\n## CLI\n\n```\n$ yarn add --global http-server-pwa\n```\n\n```\n$ http-server-pwa --help # or pwa-server --help\n\n  Usage\n\t  $ http-server-pwa [path] [options]\n\n\tOptions\n\t\t-p --port       Port to use [Default: 8080]\n\t\t-h --host       Host to use [Default: localhost | Windows: 127.0.0.1]\n\t\t-f --fallback   Fallback HTML file name [Default: index.html]\n\t\t-s --https      Enable HTTPS redirect on localhost [Default: false]\n\t\t--ssl           Auto-generation SSL certificate during development [Default: false]\n\t\t-c --cache      Enable cache for Puppeteer rendering [Default: false]\n\t\t--cacheTTL      Seconds until cached content is disregarded and puppeterized again [Default: 3600 (s)].\n\t\t-d --debug      Be more verbose [Default: false]\n\t\t-g --gzip\tEnable serving of gzipped files if available [Default: false]\n\t\t-b --brotli\tEnable serving of brotli compressed files if available [Default: false]\n\t\t-h --help       Show this message\n\n\tExamples\n\t  $ http-server-pwa\n\t  Server started -\u003e ./ localhost:8080\n\t  $ http-server-pwa dist -p 3000\n\t  Server started -\u003e ./dist localhost:3000\n```\n\n\n## License\n\nMIT © [LasaleFamine](https://godev.space)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasalefamine%2Fhttp-server-pwa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasalefamine%2Fhttp-server-pwa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasalefamine%2Fhttp-server-pwa/lists"}