Hosting on Surge.sh

Hello, is there any guide to help pakking files to host on Surge?
I tried to host my vapid site on Surge and every thing was going well, but when the site was done published It was a mess!? Any idea what Im doing wrong?

BR

Hi!

What do you mean by “it was a mess”? Did you create a static site using the vapid build command?

@Flexo Could you please provide a bit more information on what steps you took?

For reference, I think you’ll need to do what @johjakob recommended:

  1. Run vapid build, which will compile you site to static files inside of the dist directory.
  2. Deploy to Surge from the dist directory.

Hello johjskob, thank you for your replay.
by mess i ment it was just like only HTML loaded not css and i had done som field in the html and the content wasn´t there!
And yes i did vapid build. and deployed to surge this part was ok. the result as i mentioned was not great.

Hello Scott, thank you for replay.
I did vapid build first time. But i dint know that I have to run deploy from dist folder.
I tried that and surge gives back a message like this( Aborted - you do not have permission to publish ).

BR

It has nothing to do with the vapid deploy command. @scott just meant that the contents of the dist directory have to be uploaded to Surge. I assume you did that.

Can you check in the inspector of your web browser if the website outputs any error messages? Maybe, the stylesheets couldn’t be found.

@johjakob I hadn’t uploaded the files from (dist folder) before Scott said it. I got permission problems the first time i tried from (dist folder), but it went fine now after doing everything again from start. Now I have uploaded all files from (dist folder) to surge and it works fine except the login page here: http://overwrought-silver.surge.sh/dashboard I get the page not found? Any idea?

Yes, this makes sense. Surge is only capable of hosting static website. The vapid build command creates a static version out of the current state of your Vapid website. There’s no Vapid backend included.

If you want to host the full website that includes the dashboard and all the editing functionality, you need to host it on a web server that can run Node.js and therefore Vapid. There’s a bunch of web hosting providers out there that support Node.js.

Ok. I didn’t know that. I was thinking, that the dashboard was included in the dist folder. I will now try to find hosting services to try out.
Anyway, thank you very much for your time and great help. :+1:

1 Like

No worries, you’re welcome! Have fun using Vapid!