{"id":15641639,"url":"https://github.com/linusu/scandium","last_synced_at":"2025-04-06T02:07:15.148Z","repository":{"id":47615465,"uuid":"100131105","full_name":"LinusU/scandium","owner":"LinusU","description":"🚀 Easily deploy any Node.js web server to AWS Lambda","archived":false,"fork":false,"pushed_at":"2025-02-25T20:37:21.000Z","size":1656,"stargazers_count":71,"open_issues_count":8,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T21:25:34.927Z","etag":null,"topics":["api-gateway","aws-lambda","express","hacktoberfest","nodejs","serverless"],"latest_commit_sha":null,"homepage":"","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/LinusU.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":"2017-08-12T18:38:46.000Z","updated_at":"2025-02-25T20:37:25.000Z","dependencies_parsed_at":"2023-10-11T18:20:28.234Z","dependency_job_id":"2a6960c0-39f0-4de9-9151-7fa87a2a3d11","html_url":"https://github.com/LinusU/scandium","commit_stats":{"total_commits":187,"total_committers":2,"mean_commits":93.5,"dds":0.07486631016042777,"last_synced_commit":"67e0f92f7c95b520fbffd951d90c3f1df6624fcd"},"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fscandium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fscandium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fscandium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fscandium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinusU","download_url":"https://codeload.github.com/LinusU/scandium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"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":["api-gateway","aws-lambda","express","hacktoberfest","nodejs","serverless"],"created_at":"2024-10-03T11:44:12.788Z","updated_at":"2025-04-06T02:07:15.132Z","avatar_url":"https://github.com/LinusU.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scandium\n\n\u003e Easily deploy any Node.js web server to AWS Lambda.\n\nScandium can deploy your Express, Koa or similar app to lambda, without any modifications to your code. Combined with AWS API Gateway you can have your current API running serverless in no time 😎\n\n## Prerequisites\n\nScandium requires [Node.js](https://nodejs.org/), [Docker](https://docs.docker.com/get-docker/), and a working [AWS config w/ credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-where). If you are unfamiliar with the AWS config an easy way to get started is to [install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and run `aws configure`.\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n**macOS** w/ [Brew](https://brew.sh):\n\n```sh\nbrew install node\nbrew cask install docker\nbrew install awscli\naws configure\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n**Linux** w/ [Snap](https://snapcraft.io):\n\n```sh\nsudo snap install node --classic\nsudo snap install docker\nsudo snap install aws-cli --classic\naws configure\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n**Windows** w/ [winget](https://github.com/microsoft/winget-cli):\n\n```sh\nwinget install OpenJS.NodeJS\nwinget install Docker.DockerDesktop\nwinget install Amazon.AWSCLI\naws configure\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Installation\n\n```sh\nnpm install --global scandium\n```\n\n## Usage\n\nTo create a new Lambda function, use the `scandium create` command. This will package your application and upload it to AWS Lambda, as well as configure an API Gateway in front of your function.\n\n```sh\nscandium create --name=my-awesome-api\n```\n\nYou should now be presented with a url where you can access your api.\n\n\u003e Now serving live requests at: https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/default\n\nWhenever you make changes to your app, you can upload a new version of it by using the `scandium update` command. This will package your application again, and upload it as a new version to the specified Lambda function. It will also update the configuration of the API Gateway to point at the new function.\n\n```sh\nscandium update --name=my-awesome-api\n```\n\n## Tutorials\n\n- [Deploying a Next.js app to AWS Lambda](https://medium.com/@LinusU/deploying-a-next-js-app-to-aws-lambda-4dcdd233f876)\n\n## API Gateway\n\nBy default, Scandium will set up an API Gateway that simply forwards all requests to the Lambda function. If you want to utilise the benefits of API Gateway fully, you can provide a Swagger file describing your API endpoints. Pass the `--swagger=my-api-definition.yml` to either the `create` or `update` command and Scandium will configure the API Gateway for you.\n\n## Application Load Balancer\n\nThe deployed entrypoint has support for being called from an application load balancer, as well as API Gateway. Note that  \"Multi value headers\" must be turned on in the load balancer target group for this to work.\n\nThere is currently no support in the Scandium CLI to automatically setup an ALB for you.\n\n## `prepare`/`build`-scripts\n\nScandium has support for `prepare`/`build` scripts, if the script is present in the `package.json` it will make sure that the script is being run with full `devDependencies` installed. The final package being uploaded to Lambda will still only contain the production `dependencies`.\n\nIf both a `prepare` and a `build` script is present, Scandium will pick the `prepare` script.\n\n## Ignore files\n\nIf there is a `.dockerignore` file present, that one will be used when building the app. Otherwise, if a `.gitignore` file is present, that one will be used. If none of these files exists, a built in list that just contains `.git` and `node_modules` will be used.\n\n## Deploy Hooks\n\nIf you want to run any specific script inside the Lambda once during each deploy (e.g. for running database migrations), you can use the `--hooks` flag. Pass it the name of a file exporting functions for each hook you want to run.\n\nCurrently there is only one hook, named `deploy`, that will run after your Lambda is created, and before the API Gateway is updated to the new Lambda.\n\nExample file:\n\n```js\nconst runDatabaseMigrations = require('...')\n\nexports.deploy = async function () {\n  await runDatabaseMigrations()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fscandium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinusu%2Fscandium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fscandium/lists"}