How to launch Svelte on 000Webhost?

by elise_daugherty , in category: Third Party Scripts , 6 months ago

How to launch Svelte on 000Webhost?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by denis , 6 months ago

@elise_daugherty 

To launch a Svelte application on 000Webhost, you can follow these steps:

  1. Build your Svelte application: First, build your Svelte application by running the following command in your project's root directory:
1
npm run build


This will create a public folder containing the optimized build of your Svelte application.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Save and apply changes: Once you have set the document root to the correct directory, save and apply the changes in the 000Webhost dashboard.
  6. 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.