Source Code for 'Practical Rust Web Projects' by Shing Lyu

Overview

Apress Source Code

This repository accompanies Practical Rust Web Projects by Shing Lyu (Apress, 2021).

Cover image

Download the files as a zip using the green button, or clone the repository to your machine using Git.

Releases

Release v1.0 corresponds to the code in the published book, without corrections or updates.

Contributions

See the file Contributing.md for more information on how you can contribute to this repository.

You might also like...
Web framework in Rust

Rouille, a Rust web micro-framework Rouille is a micro-web-framework library. It creates a listening socket and parses incoming HTTP requests from cli

A fast, boilerplate free, web framework for Rust

Tower Web A web framework for Rust with a focus on removing boilerplate. API Documentation Tower Web is: Fast: Fully asynchronous, built on Tokio and

Sincere is a micro web framework for Rust(stable) based on hyper and multithreading

The project is no longer maintained! Sincere Sincere is a micro web framework for Rust(stable) based on hyper and multithreading. Style like koa. The

A web application completely written in Rust. 🌍
A web application completely written in Rust. 🌍

WebApp.rs A web application completely written in Rust Target of this project is to write a complete web application including backend and frontend wi

Web Server made with Rust - for learning purposes

Web Server made with Rust - for learning purposes

Archibald is my attempt at learning Rust and writing a HTTP 1.1 web server.
Archibald is my attempt at learning Rust and writing a HTTP 1.1 web server.

Archibald To be a butler, is to be able to maintain an even-temper, at all times. One must have exceptional personal hygiene and look sharp and profes

Salvo is a powerful and simplest web server framework in Rust world
Salvo is a powerful and simplest web server framework in Rust world

Salvo is an extremely simple and powerful Rust web backend framework. Only basic Rust knowledge is required to develop backend services.

Example Blog using Rust, Actix Web, HTMX, Mustache

Actix Blog An example blog built with Actix. It uses htmx and handlebar templates. Running To run the blog, you need to have a recent version of Rust

Actix-web wrapper for garde, a Rust validation library.

Garde-actix-web   Actix-web wrapper for garde, a Rust validation library. Installation Usage example Feature flags About us Installation [dependencies

Comments
  • Chapter 6 NodeJS build error

    Chapter 6 NodeJS build error

    Going through the WebAssembly+NodeJS exercises in the last chapter and ran into the following error when attempting to build the NodeJS project:

    $ npm run build
    
    > [email protected] build
    > webpack --config webpack.config.js
    
    node:internal/crypto/hash:71
      this[kHandle] = new _Hash(algorithm, xofLen);
                      ^
    
    Error: error:0308010C:digital envelope routines::unsupported
        at new Hash (node:internal/crypto/hash:71:19)
        at Object.createHash (node:crypto:133:10)
        at module.exports (/Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/webpack/lib/util/createHash.js:135:53)
        at NormalModule._initBuildHash (/Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/webpack/lib/NormalModule.js:417:16)
        at handleParseError (/Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/webpack/lib/NormalModule.js:471:10)
        at /Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/webpack/lib/NormalModule.js:503:5
        at /Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/webpack/lib/NormalModule.js:358:12
        at /Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
        at iterateNormalLoaders (/Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
        at Array.<anonymous> (/Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
        at Storage.finished (/Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
        at /Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
        at /Users/paul/repos/Apress/practical-rust-web-projects/Ch06/hello-wasm/client/node_modules/graceful-fs/graceful-fs.js:78:16
        at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
      opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
      library: 'digital envelope routines',
      reason: 'unsupported',
      code: 'ERR_OSSL_EVP_UNSUPPORTED'
    }
    
    Node.js v18.7.0
    

    After a bit of Googling, I ran across someone suggesting to run the following command:

    $ export NODE_OPTIONS=--openssl-legacy-provider
    

    Then run the build command again, and it should all compile.

    $ npm run build
    
    > [email protected] build
    > webpack --config webpack.config.js
    
    Hash: 1707689247fe60c788af
    Version: webpack 4.42.0
    Time: 67ms
    Built at: 11/08/2022 7:50:56 PM
                               Asset       Size  Chunks                         Chunk Names
                      0.bootstrap.js   5.31 KiB       0  [emitted]
    7e852f2346d8cc54b57a.module.wasm  296 bytes       0  [emitted] [immutable]
                        bootstrap.js     11 KiB    main  [emitted]              main
                          index.html  297 bytes          [emitted]
    Entrypoint main = bootstrap.js
    [../pkg/hello_wasm.js] 81 bytes {0} [built]
    [../pkg/hello_wasm_bg.js] 784 bytes {0} [built]
    [../pkg/hello_wasm_bg.wasm] 270 bytes {0} [built]
    [./bootstrap.js] 279 bytes {main} [built]
    [./index.js] 51 bytes {0} [built]
    [./node_modules/webpack/buildin/harmony-module.js] (webpack)/buildin/harmony-module.js 573 bytes {0} [built]
    

    Not exactly sure what would be the proper fix here but using --openssl-legacy-provider unblocked me.

    opened by pauldotyu 0
  • problem with cats_limit function

    problem with cats_limit function

    error[E0308]: mismatched types --> src/main.rs:35:16 | 35 | cats: cats_data, | ^^^^^^^^^^ expected struct Vec, found enum Result | = note: expected struct Vec<_> found enum Result<Vec<_>, diesel::result::Error>

    opened by TungstenRust 0
  • error[E0433]: failed to resolve: use of undeclared type `Files`

    error[E0433]: failed to resolve: use of undeclared type `Files`

    Very new to Rust.

    error[E0433]: failed to resolve: use of undeclared typeFiles``

    Screenshot 2021-05-09 at 12 01 02

    The problem in

    .service( Files::new("static/", "static") .show_files_listing(), )

    opened by aalliikk 1
Owner
Apress
Source code for books published by Apress. For more information go to www.apress.com/source-code.
Apress
A starter template for actix-web projects that feels very Django-esque. Avoid the boring stuff and move faster.

Jelly A.K.A, the actix-web starter you probably wish you had. This is provided as-is, and anyone is free to extend it or rework it as they desire - ju

SecretKeys 198 Dec 15, 2022
VRS is a simple, minimal, free and open source static web server written in Rust

VRS is a simple, minimal, free and open source static web server written in Rust which uses absolutely no dependencies and revolves around Rust's std::net built-in utility.

null 36 Nov 8, 2022
Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix Web Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust Features Supports HTTP/1.x and HTTP/2 Streaming and pipelining

Actix 16.3k Jan 8, 2023
A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. :zap::crab:

binserve ⚡ ?? A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. ?? UPDATE: N

Mufeed VH 722 Dec 27, 2022
Cookiecutter Rust Actix template for jumpstarting production-ready projects quickly.

Cookiecutter actix simple clean architecture This is a reusable Rust Cookiecutter template. The project is based on Actix web in combination with Dies

Microsoft 19 Feb 12, 2023
JSON Web Token implementation in Rust.

Frank JWT Implementation of JSON Web Tokens in Rust. Algorithms and features supported HS256 HS384 HS512 RS256 RS384 RS512 ES256 ES384 ES512 Sign Veri

Alex Maslakov 246 Dec 27, 2022
An Extensible, Concurrent Web Framework for Rust

Iron Extensible, Concurrency Focused Web Development in Rust. Response Timer Example Note: This example works with the current iron code in this repos

null 6.1k Dec 27, 2022
An expressjs inspired web framework for Rust

nickel.rs nickel.rs is a simple and lightweight foundation for web applications written in Rust. Its API is inspired by the popular express framework

null 3k Jan 3, 2023
A web framework for Rust.

Rocket Rocket is an async web framework for Rust with a focus on usability, security, extensibility, and speed. #[macro_use] extern crate rocket; #[g

Sergio Benitez 19.5k Jan 8, 2023
A lightweight web framework built on hyper, implemented in Rust language.

Sapper Sapper, a lightweight web framework, written in Rust. Sapper focuses on ergonomic usage and rapid development. It can work with stable Rust. Sa

Daogang Tang 622 Oct 27, 2022