Skip to content

Example of Rust fullstack application, using Seed for frontend and Actix-web for backend, deloyed as a single binary.

Notifications You must be signed in to change notification settings

vctibor/seed_fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fullstack Rust web application single binary example

This is an example of how to crate Rust full stack web application, using seed for frontend and actix-web for backend. We will utilize actix-web static files create to develop single binary embedding Seed frontend. We can then just run this binary to serve both frontend and API.

1. Frontend

Follow Seed quickstart.

cargo make watch

cargo make serve

2. Server

Based on https://github.com/seed-rs/seed/blob/master/examples/server_integration/server/src/main.rs.

3. Actix-web static files

Follow instructions on the actix-web static files documentation.

4. Build and run

To see steps required for build have a look at build_and_run.sh script. Reproduced here:

    cd client
    rm -rf dist
    cargo make build_release
    mkdir dist
    cp index.html dist/
    cp -r pkg dist/
    cd ..

    cd server
    cargo build
    cargo run

We will build client using command cargo make build_release, then we will copy index.html and pkg directory into dist directory that will be embedded into server binary.

Then we go to the server and execute cargo build.

About

Example of Rust fullstack application, using Seed for frontend and Actix-web for backend, deloyed as a single binary.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published