adamveld12 / svelte-go-template

Svelte, svelte-routing, tailwind, sveltestrap, svelte-awesome all embedded and served by a go backend w/ API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svelte-go-template

A simple Svelte based SPA app with a Go API server that can also embed and serve the HTML, JS, and CSS files. Handy for quick and dirty MVPs, prototypes and spikes.

The Client includes:

The Backend includes:

  • Chi router set up with some nice and easy defaults
  • Go:embed to embed the built SPA app into the binary for painless hosting
  • Set up to work with svelte-router, will serve the index.html at all unused paths instead of 404
  • Gracefull http server shutdown

Start a new project

Use degit:

npx degit adamveld12/svelte-go-template <my project folder>

Then run with make:

make dev-client # starts the client
make dev-server # starts the server

When you're ready to go to production:

make build # output in .bin folder

LICENSE

MIT

About

Svelte, svelte-routing, tailwind, sveltestrap, svelte-awesome all embedded and served by a go backend w/ API

License:MIT License


Languages

Language:Svelte 27.5%Language:JavaScript 22.0%Language:Go 21.2%Language:TypeScript 16.3%Language:Dockerfile 5.1%Language:Makefile 4.5%Language:HTML 3.5%