# AWS Adapter

Qwik Router AWS Adapter allows you to connect Qwik Router to [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html?icmpid=docs_lambda_hel).

## Installation

To integrate the `aws-lambda` adapter, use the `add` command:

```shell
pnpm run qwik add aws-lambda
```

The adapter will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:

```shell
`-- adapters/
    `-- aws-lambda
        `-- vite.config.ts
`-- src/
    `-- entry_aws-lambda.tsx
```

Additionally, within the `package.json`, the `build.server` and `serverless:preview` scripts will be updated.

## Production build

To build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:

```shell
pnpm run build
```

## Deploy to AWS

Before deployment, you need to set up your [AWS Credentials](https://www.serverless.com/framework/docs/providers/aws/guide/credentials). Under the hood,
the adapter uses [serverless](https://www.serverless.com/).

```shell
serverless deploy
```
Done!
