{"id":18596809,"url":"https://github.com/bytekast/serverless-typescript-starter","last_synced_at":"2025-05-16T13:09:39.163Z","repository":{"id":66316906,"uuid":"341424909","full_name":"bytekast/serverless-typescript-starter","owner":"bytekast","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-23T04:27:27.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-17T23:12:04.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bytekast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-02-23T04:13:57.000Z","updated_at":"2021-02-23T04:27:29.000Z","dependencies_parsed_at":"2023-03-07T21:30:38.370Z","dependency_job_id":null,"html_url":"https://github.com/bytekast/serverless-typescript-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytekast%2Fserverless-typescript-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytekast%2Fserverless-typescript-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytekast%2Fserverless-typescript-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytekast%2Fserverless-typescript-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytekast","download_url":"https://codeload.github.com/bytekast/serverless-typescript-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535828,"owners_count":22087399,"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":"2024-11-07T01:25:49.148Z","updated_at":"2025-05-16T13:09:39.146Z","avatar_url":"https://github.com/bytekast.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless TypeScript Starter\n\nA Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.\n\nThis starter uses the [serverless-bundle](https://github.com/AnomalyInnovations/serverless-bundle) plugin and the [serverless-offline](https://github.com/dherault/serverless-offline) plugin. It supports:\n\n- **Generating optimized Lambda packages with Webpack**\n- **Using TypeScript in your handler functions and tests**\n- **Run API Gateway locally**\n  - Use `serverless offline start`\n- **Support for unit tests**\n  - Run `npm test` to run your tests\n- **Sourcemaps for proper error messages**\n  - Error message show the correct line numbers\n  - Works in production with CloudWatch\n- **Lint your code with ESLint**\n- **Add environment variables for your stages**\n- **No need to manage Webpack or Babel configs**\n\n---\n\n### Demo\n\nAnd here is the TS source behind it\n\n``` javascript\nexport async function hello(\n  event: APIGatewayEvent,\n  context: Context\n): Promise\u003cAPIGatewayProxyResult\u003e {\n  return {\n    statusCode: 200,\n    body: JSON.stringify({\n      message: \"Go Serverless v2.0! Your function executed successfully!\",\n      context,\n      event,\n    }),\n  };\n}\n```\n\n### Requirements\n\n- [Install the Serverless Framework](https://serverless.com/framework/docs/providers/aws/guide/installation/)\n- [Configure your AWS CLI](https://serverless.com/framework/docs/providers/aws/guide/credentials/)\n\n### Installation\n\nTo create a new Serverless project.\n\n``` bash\n$ serverless install --url https://github.com/bytekast/serverless-typescript-starter/tree/main --name my-project\n```\n\nEnter the new directory\n\n``` bash\n$ cd my-project\n```\n\nInstall the npm packages\n\n``` bash\n$ npm install\n```\n\n### Usage\n\nTo run a function on your local\n\n``` bash\n$ serverless invoke local --function hello\n```\n\nTo simulate API Gateway locally using [serverless-offline](https://github.com/dherault/serverless-offline)\n\n``` bash\n$ serverless offline start\n```\n\nDeploy your project\n\n``` bash\n$ serverless deploy\n```\n\nDeploy a single function\n\n``` bash\n$ serverless deploy function --function hello\n```\n\n#### Running Tests\n\nRun your tests using\n\n``` bash\n$ npm test\n```\n\nWe use Jest to run our tests. You can read more about setting up your tests [here](https://facebook.github.io/jest/docs/en/getting-started.html#content).\n\n#### Environment Variables\n\nTo add environment variables to your project\n\n1. Rename `env.example` to `.env`.\n2. Add environment variables for your local stage to `.env`.\n3. Uncomment `environment:` block in the `serverless.yml` and reference the environment variable as `${env:MY_ENV_VAR}`. Where `MY_ENV_VAR` is added to your `.env` file.\n4. Make sure to not commit your `.env`.\n\n#### Linting\n\nWe use [ESLint](https://eslint.org) to lint your code via [serverless-bundle](https://github.com/AnomalyInnovations/serverless-bundle).\n\nYou can turn this off by adding the following to your `serverless.yml`.\n\n``` yaml\ncustom:\n  bundle:\n    linting: false\n```\n\nTo [override the default config](https://eslint.org/docs/user-guide/configuring), add a `.eslintrc.json` file. To ignore ESLint for specific files, add it to a `.eslintignore` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytekast%2Fserverless-typescript-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytekast%2Fserverless-typescript-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytekast%2Fserverless-typescript-starter/lists"}