{"id":21985180,"url":"https://github.com/loadmill/express-loadmill","last_synced_at":"2026-04-11T22:03:36.623Z","repository":{"id":86589169,"uuid":"96184943","full_name":"loadmill/express-loadmill","owner":"loadmill","description":"Express middleware to enable crowdsourced load simulations via loadmill.com","archived":false,"fork":false,"pushed_at":"2021-08-02T12:40:35.000Z","size":342,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T12:01:46.017Z","etag":null,"topics":["ci","cors","express","load-testing","loadmill","node"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loadmill.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-04T06:50:03.000Z","updated_at":"2021-08-02T12:40:38.000Z","dependencies_parsed_at":"2023-07-05T06:15:44.518Z","dependency_job_id":null,"html_url":"https://github.com/loadmill/express-loadmill","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.07407407407407407,"last_synced_commit":"d9aef4244edf582513c909522ab34d88544addde"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fexpress-loadmill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fexpress-loadmill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fexpress-loadmill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fexpress-loadmill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loadmill","download_url":"https://codeload.github.com/loadmill/express-loadmill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245044584,"owners_count":20551902,"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":["ci","cors","express","load-testing","loadmill","node"],"created_at":"2024-11-29T18:12:48.402Z","updated_at":"2026-04-11T22:03:36.561Z","avatar_url":"https://github.com/loadmill.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express Loadmill\nUsers of [Loadmill](https://www.loadmill.com) can use this express middleware for: \n1. Quick and easy [domain verification](https://docs.loadmill.com/setup/domain-verification).\n2. Enabling CORS **strictly** from [loadmill.com](https://www.loadmill.com) in order to perform [crowdsourced load tests](https://docs.loadmill.com/setup/testing-with-cors).\n3. Sample [performance metrics of the Node process](#monitoring) to be viewed alongside client-side metrics during a load test.\n\n## Installation\nUsing npm:\n\n`npm install express-loadmill --save`\n\nUsing yarn:\n\n`yarn add express-loadmill`\n\n## Usage\nUse loadmill middleware before everything else (that should be exposed to testing):\n```js\nvar app = require('express')();\nvar Loadmill = require('express-loadmill');\n\napp.use(Loadmill({verifyToken: process.env.LOADMILL_VERIFY_TOKEN}));\n```\n\nThe above code enables both CORS and domain verification. You may optionally disable CORS by setting the `enableCors` option to false, e.g.\n```js\napp.use(Loadmill({enableCors: false, verifyToken: process.env.LOADMILL_VERIFY_TOKEN}));\n```\nNote however that you will not be able to perform **high-volume load tests** with loadmill without enabling CORS.\n\nDomain verification will only be enabled if you supply a verification token, thus the following code will only enable CORS:\n```js\napp.use(Loadmill());\n```\n\n## Cookies\nTo enable cookies being sent to and from the server (by setting `Access-Control-Allow-Credentials` response header), \nset the `enableCookies` option to `true`, e.g.\n```js\napp.use(Loadmill({enableCookies: true, verifyToken: process.env.LOADMILL_VERIFY_TOKEN}));\n```\nNote that you will also need to enable cookies for your test in the **Advanced Settings** section of your test configuration.\n\n## Monitoring\nBy enabling performance monitoring, samples of CPU and memory usage of the Node process will be sent to Loadmill\n(only during load testing) and will be displayed alongside client-side metrics in your performance metrics charts.\n\n![express-loadmill](metrics-charts.png)\n\nThe monitoring module is an optional dependency, therefore **_you must install it._** Before installing, make sure you are using Node version **v6.1.0 or higher.**\n\nUsing npm:\n\n`npm install express-loadmill loadmill-monitor --save`\n\nUsing yarn:\n\n`yarn add express-loadmill loadmill-monitor`\n\nTo enable monitoring, you need to configure `monitor` options with a personal API token (note this is **_not_** the same as `verifyToken`):\n```js\napp.use(Loadmill({\n    verifyToken: process.env.LOADMILL_VERIFY_TOKEN,\n\n    monitor: {\n        // Required:\n        apiToken: process.env.LOADMILL_API_TOKEN,\n\n        // Default is TRUE:\n        enabled: process.env.ENABLE_LOADMILL_MONITORING\n    }\n}));\n```\n\n## Learn More\n- About [Loadmill](https://www.loadmill.com)\n- About [domain verification](https://docs.loadmill.com/setup/domain-verification)\n- About [testing with CORS](https://docs.loadmill.com/setup/testing-with-cors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadmill%2Fexpress-loadmill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floadmill%2Fexpress-loadmill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadmill%2Fexpress-loadmill/lists"}