Rendering a Svelte application (not SvelteKit) on Render

What is the start command I should use to deploy a Svelte application to Render?. I used npm run start and node build/bundle.js, but none of these commands works. Any help?

This is what I got when I use npm run start as a start command but deploy failed:

    Your application is ready~! 🚀
 
    - Local:      http://localhost:10000
    - Network:    Add `--host` to expose
  
  LOGS

Have you seen this guide https://render.com/docs/deploy-svelte ?

John B

Yes, I saw your mentioned guide. But, my app is not static, it’s consuming Restful APIs.

Sounds like you probably want to deploy it as a Django app then.

John B

Yes. But, I’m using Svelte as a front-end. I have already deployed the Django folder, and I need to do the same for the Svelte repo so that I can get two servers running.

Ah ok - the more information certainly helps us advise here.

So you want to use the same repo to deploy a Python app and a sub folder as a Svelte app?

It sounds like a perfect use case for our new Monorepo support - https://render.com/docs/monorepo-support which you can enable from your team or user settings page under ‘Early Access’

You’ll configure a Python app with an ignored path of the Svelte Subfolder
You’ll configure a second service for your Svelte app and for your build command you would prefix the normal commands with `cd and configure an include path of the svelte subfolder.

John B

Thank you so much. For the first web service (Python), can I prefix as well the build command with cd + path of the Python folder. My included and ignored paths will be the following:

Included paths: core/**
ignored paths: client/**

For the second web service (Svelte):

Included paths: client/**
ignored paths: core/**

Is it right?

That would make sense if the python folder is a sub folder in the repo - we’re going to be introducing a ‘rootDir’ concept shortly too so when that launches you won’t need to use the cd .. command, you’ll set the rootDir property and the commands will be relative to that.

John B

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.