Skip to content

Latest commit

 

History

History
 
 

sveltekit-embed

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Fiber SvelteKit Embed

A sample application to embed SvelteKit app with fiber filesystem middleware.

Requirement

  • Go 1.16
  • Node 14

Local usage

Inside the root of application directory.

Install node modules

npm install --prefix ./frontend

Build static HTML

npm run build --prefix ./frontend

Build the Go binary

go build main.go

Run the app

./main

Open http://localhost:8080/ in the browser.

Docker usage

With makefile

Build the container

make build

Run the container

make run

Open http://localhost:8080/ in the browser.

With docker command

Make it sure the static HTML already generated inside the public folder and then run:

docker build . -t sveltekit:latest

Run the container

docker run -d -p 8080:8080 --name sveltekit sveltekit:latest

Open http://localhost:8080/ in the browser.