Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

A Svelte 3 server side render example, with hashed JS and CSS chunks

License

Notifications You must be signed in to change notification settings

domingues/svelte-ssr-example

Repository files navigation

Svelte SSR Example with Code Split

A Svelte 3 server side render example, with hashed JS and CSS chunks, using rollup and rollup-plugin-css-chunks.

Installation

git clone https://github.com/domingues/svelte-ssr-example.git
cd svelte-ssr-example
npm install

Usage

npm run build
npm run start

or

npm run start:dev

and open your browser

curl http://localhost:3000/

you can pass props in the url

curl http://localhost:3000/?props={%22size%22:64}

or submit it a POST request

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"size":64}' \
  http://localhost:3000/

Environment variables

Build time

  • $PUBLIC_STATIC_PATH: path where the static files will be located, local like /static or a remote CDN like //abc.mycdn/project;

Runtime

  • $NODE_HOST
  • $NODE_PORT

License

MIT

About

A Svelte 3 server side render example, with hashed JS and CSS chunks

Resources

License

Stars

Watchers

Forks