# Azion Web Platform

[Azion](https://azion.com) is a web platform that allows you to deploy your Qwik applications globally. It provides a fast and secure way to serve your applications with low latency.

## Installation

Currently, Azion only supports SSG Qwik applications. To deploy your Qwik application to Azion, you need to use the `static-site` adapter.

To integrate the `static-site` adapter, use the `add` command:

```shell
pnpm run qwik add static
```

Above command will create a directory at project root named `adapters/static/vite.config.ts` with the below code.

```ts title="adapters/static/vite.config.ts"
import { staticAdapter } from "@qwik.dev/router/adapters/static/vite";
import { extendConfig } from '@qwik.dev/router/vite';
import baseConfig from '../../vite.config';

export default extendConfig(baseConfig, () => {
  return {
    build: {
      ssr: true,
    },
    plugins: [
      staticAdapter({
        origin: 'https://yoursite.qwik.dev',
      }),
    ],
  };
});
```

Remember to change the `origin` in this file to your domain.

Now, you can generate static site while using `Qwik`'s rich ecosystem, file based routing and many more.

## Deploy to Azion

To deploy your Qwik application to Azion, you need to install the Azion CLI. You can install it by following this [guide](https://www.azion.com/en/documentation/products/azion-cli/overview/#installing-azion-cli).

Once you have the Azion CLI installed, you can deploy your application by following these steps:

1. Link your application. This will create a new project in Azion and link it to your local application.

```shell
azion link
```

Confirm the linking of the project to Azion:

```shell
? Do you want to link /[your-application-folder] to Azion? (y/N)
```

Enter the desired name for your **application**:

```shell
? (Hit enter to accept the suggested name in parenthesis) Your application's name:  (nimble-tyrion)
```

Choose a **preset**, `Qwik` is the option you are looking for:

```shell
? Choose a preset:  [Use arrows to move, type to filter]
  ...
> Qwik
  ...
```

Now, the application will be linked to Azion. Different processes occur based on the selected preset, so you need to answer the interactions that are presented.

2. Deploy your application. This will build your application and deploy it to Azion.

```shell
azion deploy
```

3. Wait while the project is built and deployed to the Azion Web Platform.

Once the deployment is triggered, Azion will open the browser and take you to a page on the Azion Console where the deployment logs and process can be monitored. If it doesn't open automatically, just click on the provided link.

After the deployment is complete, you'll receive a domain to access your Qwik project on the Azion Platform.

Wait a few minutes for propagation to take place, and then access your application using the provided domain, which should be similar to `https://xxxxxxx.map.azionedge.net`.

For more information about the Azion Platform, check the [Azion documentation](https://www.azion.com/en/documentation/).
