{"id":16363158,"url":"https://github.com/e0ipso/subrequests-express-example","last_synced_at":"2026-05-17T00:09:52.362Z","repository":{"id":143102784,"uuid":"113764630","full_name":"e0ipso/subrequests-express-example","owner":"e0ipso","description":"An example Express app that uses Subrequests","archived":false,"fork":false,"pushed_at":"2017-12-11T10:50:12.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-22T21:11:44.569Z","etag":null,"topics":["decoupled","express","subrequests"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/e0ipso.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-12-10T16:17:57.000Z","updated_at":"2017-12-13T15:07:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"84bdcd27-1413-4470-ad33-481cd469f3fa","html_url":"https://github.com/e0ipso/subrequests-express-example","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/e0ipso/subrequests-express-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e0ipso%2Fsubrequests-express-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e0ipso%2Fsubrequests-express-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e0ipso%2Fsubrequests-express-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e0ipso%2Fsubrequests-express-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e0ipso","download_url":"https://codeload.github.com/e0ipso/subrequests-express-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e0ipso%2Fsubrequests-express-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278917011,"owners_count":26068217,"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-08T02:00:06.501Z","response_time":56,"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":["decoupled","express","subrequests"],"created_at":"2024-10-11T02:26:40.642Z","updated_at":"2025-10-08T09:07:09.777Z","avatar_url":"https://github.com/e0ipso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Subrequests Express Example\n\nAn example Express app that uses Subrequests.\n\n## Set up MySQL\nThis app depends on a mysql database.\n\n  1. Create a database named `test` in your MySQL server.\n  1. Import the table structures from `tables.sql` in the database.\n  1. Once the tables are created, then import the sample data from `dump.sql`.\n  1. Edit `db.js` to add your MySQL username and password replacing the `root:root` section.\n\n## Test the API\nMake the following requests to understand the exposed API:\n\n  * `[GET]` http://localhost:3002/customer\n  * `[GET]` http://localhost:3002/user\n  * `[POST]` http://localhost:3002/subrequests with body\n  ```json\n  [\n    {\n      \"requestId\": \"customers\",\n      \"action\": \"view\",\n      \"uri\": \"/customer\"\n    },\n    {\n      \"requestId\": \"users\",\n      \"action\": \"view\",\n      \"uri\": \"/user/{{customers.body@$.*.User_id}}\",\n      \"waitFor\": [\"customers\"]\n    },\n    {\n      \"requestId\": \"githubs\",\n      \"action\": \"view\",\n      \"uri\": \"https://api.github.com/users/{{users.body@$.*.Github_handle}}\",\n      \"headers\": { \"User-Agent\": \"Subrequests\" },\n      \"waitFor\": [\"users\"]\n    }\n  ]\n  ```\n  * `[GET]` http://localhost:3002/subrequests?query=%5B%7B%22requestId%22%3A%22customers%22%2C%22action%22%3A%22view%22%2C%22uri%22%3A%22%2Fcustomer%22%7D%2C%7B%22requestId%22%3A%22users%22%2C%22action%22%3A%22view%22%2C%22uri%22%3A%22%2Fuser%2F%7B%7Bcustomers.body%40%24.%2A.User_id%7D%7D%22%2C%22waitFor%22%3A%5B%22customers%22%5D%7D%2C%7B%22requestId%22%3A%22githubs%22%2C%22action%22%3A%22view%22%2C%22uri%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2F%7B%7Busers.body%40%24.%2A.Github_handle%7D%7D%22%2C%22headers%22%3A%7B%22User-Agent%22%3A%22Subrequests%22%7D%2C%22waitFor%22%3A%5B%22users%22%5D%7D%5D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe0ipso%2Fsubrequests-express-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe0ipso%2Fsubrequests-express-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe0ipso%2Fsubrequests-express-example/lists"}