{"id":28403409,"url":"https://github.com/anomalyinnovations/serverless-typescript-starter","last_synced_at":"2025-06-27T08:32:35.831Z","repository":{"id":45646435,"uuid":"304490558","full_name":"AnomalyInnovations/serverless-typescript-starter","owner":"AnomalyInnovations","description":"A Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.","archived":false,"fork":false,"pushed_at":"2021-12-02T22:39:17.000Z","size":142,"stargazers_count":83,"open_issues_count":4,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T02:34:01.305Z","etag":null,"topics":["jest","serverless","serverless-bundle","serverless-framework","serverless-offline","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/AnomalyInnovations.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}},"created_at":"2020-10-16T01:43:41.000Z","updated_at":"2025-05-29T06:16:16.000Z","dependencies_parsed_at":"2022-09-03T00:42:12.017Z","dependency_job_id":null,"html_url":"https://github.com/AnomalyInnovations/serverless-typescript-starter","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/AnomalyInnovations/serverless-typescript-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnomalyInnovations%2Fserverless-typescript-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnomalyInnovations%2Fserverless-typescript-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnomalyInnovations%2Fserverless-typescript-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnomalyInnovations%2Fserverless-typescript-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnomalyInnovations","download_url":"https://codeload.github.com/AnomalyInnovations/serverless-typescript-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnomalyInnovations%2Fserverless-typescript-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262222641,"owners_count":23277480,"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":["jest","serverless","serverless-bundle","serverless-framework","serverless-offline","typescript"],"created_at":"2025-06-01T17:36:45.994Z","updated_at":"2025-06-27T08:32:35.823Z","avatar_url":"https://github.com/AnomalyInnovations.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless TypeScript Starter [![Seed Status](https://api.seed.run/serverless-stack/serverless-typescript-starter/stages/prod/build_badge)](https://console.seed.run/serverless-stack/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\nA demo version of this service is hosted on AWS - [`https://ylsml6v6r6.execute-api.us-east-1.amazonaws.com/dev/hello`](https://ylsml6v6r6.execute-api.us-east-1.amazonaws.com/dev/hello)\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/AnomalyInnovations/serverless-typescript-starter --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\n### Support\n\n- Open a [new issue](https://github.com/AnomalyInnovations/serverless-typescript-starter/issues/new) if you've found a bug or have some suggestions.\n- Or submit a pull request!\n\n---\n\nThis repo is maintained by [Anomaly Innovations](https://anoma.ly); makers of [Seed](https://seed.run) and [Serverless Stack](https://serverless-stack.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanomalyinnovations%2Fserverless-typescript-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanomalyinnovations%2Fserverless-typescript-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanomalyinnovations%2Fserverless-typescript-starter/lists"}