Skip to content

david-wallace-croft/spin-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CroftSoft Spin Prototype

MIT licensed

  • A collection of Fermyon Spin example components
    • Rust code compiled to WebAssembly (Wasm) running as Serverless in the Cloud

Usage

  • Install the Fermyon Spin command line utility "spin"
  • spin build
  • spin up
    • If running on Windows, you might have to do some workarounds
      • See fermyon/spin#2112
      • Build spin-fileserver in a sibling directory
        • cd ../spin-fileserver
        • cargo build --release
        • cd ../spin-prototype
      • Update the path to spin_static_fs.wasm in spin.toml
      • spin up --direct-mounts

Test 0: Static File Server

Test 1: Hello World

Test 2: CRUD REST API

Test 3: JSON I/O

  • Demonstrates JSON input and output
  • Post the name in a JSON object
    • Responds with a JSON object containing a message
curl -i -X POST \
  -d "{\"name\": \"World\"}" \
  localhost:3000/test3

Test 4: AI LLM

  • Demonstrates use of an Artificial Intelligence (AI) Large Language Model (LLM)
curl -i -X POST \
  -d "{\"characters\": [\"Gilgamesh\", \"Utnapishtim\"]}" \
  localhost:3000/test4

Test 5: REST from Spin

TODO

  • Authentication (AuthN) / Authorization (AuthZ) example
    • Might use OAuth 2.0 / OpenID Connect (OIDC)

Links

History

  • Initial release: 2023-11-25

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published