Deploying your Stratox project is straightforward. This guide will walk you through building your project and deploying it to popular services like GitHub Pages, Netlify, Vercel and more.
Building Your Stratox Project
To build your Stratox project, run the following command in your terminal:
npmrunbuild
This command will compile your app and output the static files into a directory named dist located in your project's root directory. These files are ready to be deployed to a hosting service of your choice.
Deploying to GitHub Pages
GitHub Pages is a free hosting service that lets you host static websites directly from your GitHub repository.
Steps:
Initialize a Git Repository (if you haven't already):
gitinitgitadd.gitcommit-m"Initial commit"
Create a gh-pages Branch:
gitcheckout-bgh-pages
Copy the dist Contents to the Root:
Replace the contents of your repository with the built files:
rm-rf!(dist)cp-rdist/*.rm-rfdist
Commit and Push to gh-pages Branch:
gitadd.gitcommit-m"Deploy to GitHub Pages"gitpushorigingh-pages
Netlify will provide a URL where your app is deployed.
Deploying to Vercel
Vercel offers a seamless experience for deploying static sites and serverless functions.
Steps:
Install Vercel CLI:
Login to Vercel:
Deploy Your Project:
When prompted, set the output directory to dist.
Configure Project Settings (if needed):
You can adjust settings in the vercel.json file.
Access Your Deployed App:
Vercel will provide a URL where your app is deployed.
Deploying to Other Services
The dist folder contains all the static files needed to run your app. You can deploy these files to any static hosting service, such as:
Amazon S3 and CloudFront
Firebase Hosting
GitLab Pages
Surge.sh
General Steps:
Sign Up for the Service:
Create an account on your chosen hosting platform.
Upload the dist Folder:
Use the platform's interface or CLI tools to upload your static files.
Configure Domain and Settings:
Set up any necessary configurations, such as custom domains or SSL certificates.
Access Your Deployed App:
Your app should now be live at the URL provided by the hosting service.
Conclusion
Deploying your Stratox project is as simple as building your app and uploading the contents of the dist folder to your preferred hosting service. With platforms like GitHub Pages, Netlify, and Vercel, you can have your app live in just a few minutes.
If you encounter any issues during deployment, consult the documentation of the hosting service or reach out to the Stratox community for support.