Azion Web Platform
Azion 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:
pnpm run qwik add static
npm run qwik add static
yarn run qwik add static
bun run qwik add static
Above command will create a directory at project root named adapters/static/vite.config.ts
with the below code.
import { staticAdapter } from "@builder.io/qwik-city/adapters/static/vite";
import { extendConfig } from '@builder.io/qwik-city/vite';
import baseConfig from '../../vite.config';
export default extendConfig(baseConfig, () => {
return {
build: {
ssr: true,
rollupOptions: {
input: ['@qwik-city-plan'],
},
},
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.
Once you have the Azion CLI installed, you can deploy your application by following these steps:
- Link your application. This will create a new project in Azion and link it to your local application.
azion link
Confirm the linking of the project to Azion:
? Do you want to link /[your-application-folder] to Azion? (y/N)
Enter the desired name for your application:
? (Hit enter to accept the suggested name in parenthesis) Your application's name: (nimble-tyrion)
Choose a preset, Qwick
is the option you are looking for:
? 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.
- Deploy your application. This will build your application and deploy it to Azion.
azion deploy
- 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.