Giter VIP home page Giter VIP logo

start-spin's Introduction

Leptos Logo

Leptos Spin SSR Starter Template

This is a template for use with the Leptos web framework and the Spin WASI platform.

Click here to see the deployed version of this starter.

Creating Your Repo

First, ensure that you have Rust 'nightly' with both the wasm and wasm32-wasi targets, along with cargo-generate

  • rustup toolchain install nightly --allow-downgrade
  • rustup target add wasm32-unknown-unknown
  • rustup target add wasm32-wasi
  • cargo install cargo-generate

If you don't have spin installed you can install it with

curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash

Once you have the Spin CLI tool downloaded, we recommend putting the binary into a folder already on your path, eg

sudo mv spin /usr/local/bin/

For the full Spin CLI install instructions see here.


To generate your own repo from this starter template, run

cargo generate --git https://github.com/leptos-rs/start-spin

Then

cd {{project-name}}

to go to your newly created project.


Feel free to explore the project structure, but the best place to start with your application code is in src/pages/home.rs.

Additionally, Cargo.toml may need updating as new versions of the dependencies are released, especially if things are not working after a cargo update.

Running & Developing Your Project

Running

spin watch

will build and run your server as well as recompile your code after making changes.

Using

spin up

will build and serve your app on 127.0.0.1:3000 by default. To serve at a different address, use spin up --listen <ADDRESS>.

Release and Deployment

To deploy your app to Fermyon Cloud signup here first. For more information on Ferymon Cloud see here.

After you have your Fermyon cloud account and have logged in using spin login, running

spin build

will build your application for release. Running

spin deploy

will publish your app to Fermyon cloud.

If you would prefer to deploy your app on own machine or in a VM with Docker rather than on Fermyon Cloud, see the Spin in Docker setup instructions here.


If you would like to deploy your Leptos-Spin app via Kubernetes, see the setup instructions for Spin on Kubernetes here.

start-spin's People

Contributors

benwis avatar diversable avatar sjud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sjud

start-spin's Issues

serving public files on root

Files on public folder like public/favicon.ico doesn't get served, returning 404, but moving it to public/pkg/favicon.ico does work. How to serve files on root like 127.0.0.1:3000/favicon.ico?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.