{"id":15919923,"url":"https://github.com/chadfawcett/probot-serverless-now","last_synced_at":"2025-03-24T09:32:04.228Z","repository":{"id":34240766,"uuid":"163028810","full_name":"chadfawcett/probot-serverless-now","owner":"chadfawcett","description":"A Probot extenstion to make it easier to run your Probot Apps on Zeit Now v2","archived":false,"fork":false,"pushed_at":"2023-03-02T15:59:45.000Z","size":2703,"stargazers_count":10,"open_issues_count":25,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T21:19:27.692Z","etag":null,"topics":["extenstion","now","probot","probot-apps","probot-serverless","zeit"],"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/chadfawcett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-12-24T23:15:26.000Z","updated_at":"2024-06-11T14:54:02.000Z","dependencies_parsed_at":"2024-10-28T23:40:26.340Z","dependency_job_id":"3c1bd5b8-16d8-4b7b-a3e9-6def072db633","html_url":"https://github.com/chadfawcett/probot-serverless-now","commit_stats":{"total_commits":32,"total_committers":3,"mean_commits":"10.666666666666666","dds":0.0625,"last_synced_commit":"837b157ff15e26d301da6c879f27a8296e5d3afa"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadfawcett%2Fprobot-serverless-now","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadfawcett%2Fprobot-serverless-now/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadfawcett%2Fprobot-serverless-now/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadfawcett%2Fprobot-serverless-now/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chadfawcett","download_url":"https://codeload.github.com/chadfawcett/probot-serverless-now/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245243405,"owners_count":20583618,"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":["extenstion","now","probot","probot-apps","probot-serverless","zeit"],"created_at":"2024-10-06T19:06:50.849Z","updated_at":"2025-03-24T09:32:03.881Z","avatar_url":"https://github.com/chadfawcett.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm Version](https://img.shields.io/npm/v/@chadfawcett/probot-serverless-now.svg)](https://npmjs.com/package/@chadfawcett/probot-serverless-now)\n[![Build Status](https://semaphoreci.com/api/v1/chadfawcett/probot-serverless-now/branches/master/shields_badge.svg)](https://semaphoreci.com/chadfawcett/probot-serverless-now)\n\n# Zeit Now v2 Extension for Probot\n\n\u003e A [Probot](https://github.com/probot/probot) extenstion to make it easier to\n\u003e run your Probot Apps on [Zeit Now v2](https://zeit.co/now)\n\nZeit Now v2 changes its functionality from long-running processes to functions.\nThis means v2 deployments can't start `probot run`, and instead need direct\naccess to the App's endpoint.\n\n## Usage\n\n```bash\n$ npm install @chadfawcett/probot-serverless-now\n```\n\n```js\n//  now.js\nvar { serverless } = require('@chadfawcett/probot-serverless-now')\nconst appFn = require('./')\nmodule.exports = serverless(appFn)\n```\n\n```js\n//  index.js\nmodule.exports = app =\u003e {\n  app.on('issues.opened', async context =\u003e {\n    // A new issue was opened, what should we do with it?\n    context.log(context.payload)\n  })\n}\n```\n\n```json\n// now.json\n{\n  \"version\": 2,\n  \"env\": {\n    \"APP_ID\": \"@app-id\",\n    \"WEBHOOK_SECRET\": \"@webhook-secret\",\n    \"PRIVATE_KEY\": \"@private-key-base64-encoded\"\n  },\n  \"builds\": [{ \"src\": \"now.js\", \"use\": \"@now/node\" }],\n  \"routes\": [{ \"src\": \"/\", \"dest\": \"/now.js\" }]\n}\n```\n\n```bash\n$ now # Deploy using now!\n```\n\n## Using Routes\n\nZeit Now [encourages multiple granular\nendpoints](https://github.com/zeit/docs/blob/b20b65e0aad632f9a27f82fab9148f51a70c3fd6/pages/docs/v2/deployments/concepts/lambdas.mdx#L111-L121)\ninstead of one monolithic app, so whenever possible you should separate custom\nrouting. That being said, there may be cases for wanting to have custom routes\ninside of your app using `app.route()`. To enable this, simply change the `src`\npath in your `now.json` to have a wildcard ending (`\"src\": \"/*\"`).\n\n```json\n{\n  ...\n  \"routes\": [{ \"src\": \"/*\", \"dest\": \"/now.js\" }]\n}\n```\n\n## Multiple Apps\n\nAs mentioned in [using routes](#using-routes), monolithic apps are discouraged.\nThat being said, there may be a use case for running multiple Probot Apps\ntogether (ie logging, stats, etc). For this reason the `serverless` function\nalso accepts an array of app functions.\n\n```js\nvar { serverless } = require('@chadfawcett/probot-serverless-now')\nconst statsApp = require('probot/lib/apps/stats')\nconst myApp = require('./')\n\nmodule.exports = serverless([statsApp, myApp])\n```\n\n## API\n\n### `serverless(appFn[, options])`\n\nCreate a new instance of Probot and load the supplied App\\[s\\].\n\n#### Parameters\n\n\u003c!-- prettier-ignore-start --\u003e\nName | Type | Required | Description\n--- | --- | --- | ---\nappFn | function \\| array | true | Single or array of of Probot App functions\noptions | [object](#options) | false | Probot config options\n\u003c!-- prettier-ignore-end --\u003e\n\n#### Options\n\n\u003c!-- prettier-ignore-start --\u003e\nName | Type | Default | Description\n--- | --- | --- | ---\nid | number | process.env.APP_ID | The App ID assigned to your GitHub App\nsecret | string | process.env.WEBHOOK_SECRET | The webhook secret used when creating a GitHub App\ncert | string | [findPrivateKey()](https://github.com/probot/probot/blob/bb06c51485245d75508982826180e7c2e774a7db/src/private-key.ts#L12-L22) | The contents of the GitHub App private key (multiline or base64)\n\u003c!-- prettier-ignore-end --\u003e\n\n**Example**\n\nWith default options\n\n```js\nvar { serverless } = require('@chadfawcett/probot-serverless-now')\nconst appFn = require('./')\nmodule.exports = serverless(appFn)\n```\n\nWith custom options\n\n```js\nvar { serverless } = require('@chadfawcett/probot-serverless-now')\nconst appFn = require('./')\n\nconst options = {\n  id: 123,\n  secret: process.env.MY_SECRET,\n  cert: process.env.MY_PRIVATE_KEY\n}\n\nmodule.exports = serverless(appFn, options)\n```\n\n## Install\n\nWith [npm](https://npmjs.org/) installed, run\n\n```\n$ npm install @chadfawcett/probot-serverless-now\n```\n\nThis package is meant to be installed alongside your Probot app, so `probot` is\na peer dependency.\n\n## Acknowledgments\n\n[@chadfawcett/probot-serverless-now](#) was inspired by [probot/serverless-lambda](https://github.com/probot/serverless-lambda)\n\n## See Also\n\n- [`passionkind/probot-serverless-now`](https://github.com/passionkind/probot-serverless-now#readme)\n- [`tibdex/probot-serverless-now`](https://github.com/tibdex/probot-serverless-now)\n- [`noffle/common-readme`](https://github.com/noffle/common-readme)\n\n## License\n\n[MIT](https://github.com/chadfawcett/probot-serverless-now/blob/master/LICENSE.md) Copyright Chad Fawcett\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadfawcett%2Fprobot-serverless-now","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchadfawcett%2Fprobot-serverless-now","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadfawcett%2Fprobot-serverless-now/lists"}