DEV Community

Adam Szadkowski
Adam Szadkowski

Posted on

Running Sapper on shared hosting

This is a short way to publish your Sapper app to shared hosting that has node.js. This post is solution for the hosting that I've been using, but maybe it can transfer to some other shared hosting sites.

My assumption is:

  1. Your host gives you shell (ssh) access.
  2. You have dedicated folder ie. public_nodejs where you hosting forces you to put the node.js apps.
  3. You host forces you to use app.js as start point for your application.

I'm assuming you are one folder above the public_nodejs. --force because we want to clone the repo into the directory that already exists.

cd public_nodejs
npx degit "sveltejs/sapper-template#rollup" --force
npm install
npm run build

Create app.js and upload, or just use nano

require("./__sapper__/build/index.js");

Voila, your application works.

PS. Wanted to throw it in a post, so if someone else will struggle with this they have a simple solution.

Top comments (0)