{"id":26716602,"url":"https://github.com/javascript-studio/studio-gateway","last_synced_at":"2025-03-27T15:37:59.127Z","repository":{"id":217650416,"uuid":"66111286","full_name":"javascript-studio/studio-gateway","owner":"javascript-studio","description":"🚥 A custom Swagger interpreter with AWS Lambda integration support, for local API Gateway testing","archived":false,"fork":false,"pushed_at":"2024-01-17T12:27:55.000Z","size":310,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T19:43:42.876Z","etag":null,"topics":[],"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/javascript-studio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.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}},"created_at":"2016-08-19T20:46:54.000Z","updated_at":"2024-01-17T12:34:00.000Z","dependencies_parsed_at":"2024-01-17T18:33:49.579Z","dependency_job_id":"94357336-8400-4c3f-a23b-e8df3245b446","html_url":"https://github.com/javascript-studio/studio-gateway","commit_stats":null,"previous_names":["javascript-studio/studio-gateway"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javascript-studio","download_url":"https://codeload.github.com/javascript-studio/studio-gateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245856195,"owners_count":20683646,"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":[],"created_at":"2025-03-27T15:37:58.331Z","updated_at":"2025-03-27T15:37:59.109Z","avatar_url":"https://github.com/javascript-studio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Studio Gateway\n\nA custom [Swagger][] server and compiler with [AWS Lambda\nand mock integration][aws-int], for local API Gateway testing.\n\n## Features\n\n- Request parameters, header \u0026 query mappings\n- Request body models\n- Request-/Response Velocity templates and JSON Path queries\n- Response mappings with regular expressions\n- Response headers\n- AWS Lambda integration\n- AWS Mock integration\n- Swagger `$ref` to external files - compiles to single AWS compatible file\n\n## Usage\n\nAssuming a `swagger.json` file in the current directory:\n\n```js\nconst Gateway = require('@studio/gateway');\nconst Lambda = require('@studio/lambda');\n\nconst lambda = Lambda.create();\nconst gateway = Gateway.create();\ngateway.on('lambda', lambda.invoke);\ngateway.listen(1337);\n```\n\n## API\n\n- `gateway = Gateway.create([options])`: Returns a new gateway server\n  for the given options.\n  - `swagger_file`: The swagger file to read. Defaults to `swagger.json`.\n  - `swagger_env`: The [dotenv][] config to read.\n  - `stage`: The stage name to use. Defaults to \"local\".\n  - `stageVariables`: The stage variables to use. Default to an empty object.\n- `gateway.listen(port[, callback])`: Bind the server to the given port.\n\n## Events\n\n- `lambda(name, event, context, callback)`: When a Lambda integration should be\n  invoked. See [@studio/lambda][] for a custom Lambda execution environment.\n\n## Swagger command\n\nThis module ships with a `swagger` command to compile a `swagger.json` file with\nreferences to other files into a single AWS compatible file.\n\nUse in npm scripts like this:\n\n```json\n{\n  \"scripts\": {\n    \"swagger:prod\": \"swagger -o target/swagger-prod.json\"\n  }\n}\n```\n\nThe `swagger` optionally loads the [dotenv][] module and replaces environment\n`${variables}`.\n\nThese options are supported:\n\n- `-f, --file`: Sets the name of the swagger file. Defaults to `swagger.json`.\n- `-e, --env`: Sets the path to a `dotenv` config file.\n- `-o, --outfile`: Defines the output file to write to. If not specified, the\n  result is printed to standard out.\n\nNote that all environment variables can be used. When using npm scripts as\nshown above, you can also do things like `${npm_package_version}`.\n\n[Swagger]: http://swagger.io\n[aws-int]: http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html\n[@studio/lambda]: https://github.com/javascript-studio/studio-lambda\n[dotenv]: https://www.npmjs.com/package/dotenv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Fstudio-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavascript-studio%2Fstudio-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Fstudio-gateway/lists"}