To launch a Svelte application on 000Webhost, you can follow these steps:
- Build your Svelte application: First, build your Svelte application by running the following command in your project's root directory:
This will create a
public folder containing the optimized build of your Svelte application.
- Sign up and create a new website: Go to the 000Webhost website (https://www.000webhost.com/) and sign up for a new account. Once you are signed in, create a new website by following the steps provided.
- Access the File Manager: After creating your website, go to the 000Webhost dashboard and find the "Manage Website" section. Look for the File Manager option and click on it.
- Upload your Svelte build files: In the File Manager, navigate to the public folder of your Svelte application on your local machine. Select all the files and folders inside the public folder and upload them to the root directory of your 000Webhost website using the "Upload Files" option in the File Manager.
- Set up the project's root as public: By default, the document root on 000Webhost is set to the public_html folder. To make your Svelte application accessible, you need to set the website's document root to the root directory where you uploaded your Svelte build files. You can usually find this option in the website's settings or hosting options within the 000Webhost dashboard. Look for an option to set the "Document Root" or similar.
- Save and apply changes: Once you have set the document root to the correct directory, save and apply the changes in the 000Webhost dashboard.
- Test your Svelte application: Wait for a few minutes for the changes to take effect, and then access your website's URL in a web browser. You should see your Svelte application up and running.
That's it! Your Svelte application should now be successfully launched on 000Webhost.