Deploying to Production
We have our application ready, and now it's time to deploy it to production.
This is a pretty new technology, and there is not a lot of documentation. If you run into any issues, please let us know in the Discord community.
Configuring Headers
Remember the headers we set in our vite.config.ts
file. That helps us in development but when we try to deploy the respective hosting provider reset those headers (basically not considering them).
To fix this, we need to set the headers in the hosting provider itself. Here is how you can do it in Vercel:
We have already created a vercel.json
file in our repo. It would have the following content:
Deployment
We want you to deploy the application to Vercel. Here is how you can do it:
- Push the changes to your GitHub repository.
- Go to Vercel and sign in with your GitHub account.
- Click on the
Import Project
button. - Select the repository you want to deploy.
- Configure the settings and click on the
Deploy
button.
That's it! Your application is now live.
If you are not using Vercel, you can follow the respective hosting provider's documentation to deploy the application and the respective headers from here.
Troubleshooting
We have deployed it and know that it works. But what if it doesn't? Try troubleshooting the issue. This is how you get better at it.